Why do the MongoDB docs recommend not using DBREFs?
Here a conclusion of all I viewed.
Using DBRef
is not a join
operation, it will automatically query the second or more times, depends on how much DBRef
you have got in this collection fields.
Assuming you have a collection that its model has 10 DBRef
, you make query for 10 elements' list of it and one of these DBRef
is really needed
. Once you query, Mongodb will runs 101(1 + 10*10)
queries, automatically, no matter you need these DBRef
or not. If you query these field manually, just a few coding and only 11(1 + 1*10)
queries are needed.
So, what do you say?