M
M
magary42015-05-27 15:17:20
MongoDB
magary4, 2015-05-27 15:17:20

Is it possible to make a nested query in mongo against another table?

for example, there is a collection of events [{id:"4e2f2af16f1e7e4c2000000a",name:"First event", date:ISODate("2011-07-26T21:02:19Z")}, ... ]
and there is a collection of reviews [id:"" ,event:"4e2f2af16f1e7e4c2000000a",score:5]
get
[{id:"4e2f2af16f1e7e4c2000000a",name:"First event", date:ISODate("2011-07-26T21:02:19Z"), reviews :[id: "",event:"4e2f2af16f1e7e4c2000000a",score:5]}, ... ]
so that you can later bind to a collection in meteorjs

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
s2dent, 2015-05-29
@s2dent

You can read here and here .

L
lega, 2015-05-27
@lega

There are no joins in the mongo itself, but you can store reviews directly in events.

A
Alexander Prozorov, 2015-05-28
@Staltec

1. Desperately break with the past in the form of relational databases and heroically switch to MongoDB (NoSQL - stylish, fashionable, youthful).
2. Ask a question on Toaster (Stack Overflow, [email protected], etc) how to do JOINs in MongoDB.
3.???
4. PROFIT!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question