4 ms·
You're going to a depth that is testing the limits of my example :) You wouldn't have to do that. You can have deep indexes, and query on those attributes. S
by angilly 16y ago
You're going to a depth that is testing the limits of my example :) You wouldn't have to do that. You can have deep indexes, and query on those attributes. So if events had invites embedded, and invites all had email addresses for their recipients:
db.users.find({'events.invites.email': 'sv123@gmail.com'})
and that would return all the users that had invited you to an event.
Now, like I said you're testing my example. When these kinds of requirements are taken into account, you'd probably want to have a separate collection for events. Then you could do:
db.events.find({'invites.email': 'sv123@gmail.com'})