4

Returning to classic mongodb example (posts and users):

Posts:

{title: "Greetings", body:"Hello world", userId:12345}

Users:

{_id:12345, name:"John Smith", email:john@smith.org"}

How to get post

{title: "Greetings", body:"Hello world", <username>:"John Smith"}

with a sigle query?

Jeriho
  • 7,129
  • 9
  • 41
  • 57
  • Possible duplicate of [MongoDB: Combine data from multiple collections into one..how?](http://stackoverflow.com/questions/5681851/mongodb-combine-data-from-multiple-collections-into-one-how) – AlikElzin-kilaka Dec 10 '16 at 06:23

1 Answers1

3

MongoDB is not an RDBMS - so NO JOINS - either you use two queries or you use embedding or you look at "database references".