欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

【MongoDB】Theconnectionbetweentwotables

程序员文章站 2024-02-15 18:55:40
...

In mongoDB, there are two general way to connect with two tables. Manual Connection and use DBRef 1. Basically manual connection Firstly init the data which was saved in the different collections. The result: 2 usage of DBRef grammar: the

In mongoDB, there are two general way to connect with two tables. Manual Connection and use DBRef

1. Basically manual connection

Firstly init the data which was saved in the different collections.

【MongoDB】Theconnectionbetweentwotables

The result:

【MongoDB】Theconnectionbetweentwotables

2 usage of DBRef

grammar:

【MongoDB】Theconnectionbetweentwotables

the example:

【MongoDB】Theconnectionbetweentwotables

Attention: the above example has some question;