Vote count:
0
I'm new to MongoDB and would like help with a data model for this simple scenario. My database has three objects:
- User { id }
- Document { id, updated }
- Favorite { userId, documentId }
I need a query that selects all the Favorites for a given user, and orders the resulting Favorites based on the updated time of their Document. This query, and my current seperate three object design, seems more suited to a relational database.
Any suggestions on rethinking my data model so that the query can be performed in an efficient and scalable manner? Perhaps embedding the Favorites inside of their target Documents or Users?
asked 39 secs ago
MongoDB Schema For Query Ordered on Relation Property
Aucun commentaire:
Enregistrer un commentaire