I’m doing an app where users can follow topics.
What is the best schema for implement with mongodb and meteor?
I thought to 2 solutions:
FIRST
With one collection:
Schemas.Follow = new SimpleSchema({
userId: { type: String }
topicId: { type: String }
}
Pro: no problems with document 16MB limit
Cons: performances for search are slow (?)
SECOND
use ids array in users and topics collection
Schemas.User = new SimpleSchema({
…
follows: { type: [String] }
}
Schemas.Topic = new SimpleSchema({
…
followedBy: { type: [String] }
}
Pro: better performance of search
Cons: problem of 16MB limit per document
Have you a better solution for mongodb and meteor?
Thanks!