Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // user document
- {
- "userId" : "user1",
- "events" : {
- "created" : [
- "event1",
- "event2"
- ],
- "won" : [
- "event3"
- ],
- "onHold" : [
- "event4",
- "event5"
- ]
- }
- }
- // events documetns
- {
- "userId" : "user1",
- "eventId" : "event1",
- "participants" : [
- "participant1",
- "participant2",
- ]
- }
- devo fare una query che, prenda come argomento un userId, tiri fuori i vari "events", faccia una loockup di questi eventi e alla fine torni un qualcosa del genere
- ["created" : [
- "{
- "userId" : "user1",
- "eventId" : "event1",
- "participants" : [
- "participant1",
- "participant2",
- ]
- },
- {
- "userId" : "user1",
- "eventId" : "event2",
- "participants" : [
- "participant1",
- "participant2",
- ]
- }
- ],
- "won" : [
- {
- "userId" : "userX",
- "eventId" : "event3",
- "participants" : [
- "participant1",
- "participant2",
- ]
- }
- ],
- "onHold" : [
- {
- "userId" : "userX",
- "eventId" : "event4",
- "participants" : [
- "participant1",
- "participant2",
- ]
- },
- {
- "userId" : "userX",
- "eventId" : "event5",
- "participants" : [
- "participant1",
- "participant2",
- ]
- }
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement