MongoDB - is DBREF necessary?

前端 未结 3 639
無奈伤痛
無奈伤痛 2020-12-01 05:17

Using the DBREF datatype in MongoDB, a document may look like as shown below. But having the $ref field in every row feels redundant as every row obviously poin

3条回答
  •  没有蜡笔的小新
    2020-12-01 06:19

    Unless you use driver specific methods for accessing dbref, it should be unnecessary.

    In cases where you're managing the join manually (i.e. you know which other collection to "join" to), storing just the ObjectId is enough.

提交回复
热议问题