Hello. I am wondering what document structure I should use to solve the problem below:
The data that I want to store maps a user ID to a User account. Each user account can have many “events”, and those events are stored by ID under each account (not globally). I would like to be able to quickly lookup an event by UUID without enumerating each one on every request.
Here is an example JSON User account:
{
name: "Joe",
events: {
"51a9436e-b038-...": {
startTime: ...,
endTime: ...,
...
},
"4d3ab18f-ad40-...": {
startTime: ...,
endTime: ...,
...
},
... (many more events, probably 100-1000)
}
}
How best can I map this to MongoDB, or is there an alternative database that I should use?
Any help would be greatly appreciated!