当前位置:网站首页>Relationship between mongodb documents
Relationship between mongodb documents
2022-07-05 20:17:00 【Why not sell egg cakes well】
12 Relationship between documents
one-on-one
Embedded document form
Relatively few
db.wifeAndHusband.insert([{
name:" Huang Rong ",
husband:{
name:" Guo Jing "
}
}])
One to many
user –》 Order
db.order.insert({
list:[" beef "," comic "],
user_id:ObjectId("hhjhdfgjk");
})
// Find user swk The order of
var user_id=db.users.findOne({username:"swk"})._id;
db.order.find({user_id:user_id});
Many to many
db.teacher.insert([
{
name:" Common wife Palace "},
{
name:" Tortoise Fairy "}
]);
db.stus.insert([
{
name:" Guo Jing ",
tech_ids:[
ObjectId("kkkk"),
ObjectId("djslgkdj")
]
}
]);
边栏推荐
- Leetcode brush question: binary tree 14 (sum of left leaves)
- 股票开户哪里好?网上客户经理开户安全吗
- Four methods of random number generation | random | math | threadlocalrandom | securityrandom
- js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
- When JS method passes long type ID value, precision loss will occur
- mongodb基操的练习
- Leetcode brush question: binary tree 13 (the same tree)
- 无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...
- 怎么挑选好的外盘平台,安全正规的?
- Is it safe for Galaxy Securities to open an account online?
猜你喜欢

Elk distributed log analysis system deployment (Huawei cloud)

Let's talk about threadlocalinsecurerandom

Leetcode skimming: binary tree 17 (construct binary tree from middle order and post order traversal sequence)

IC科普文:ECO的那些事儿

Leetcode skimming: binary tree 10 (number of nodes of a complete binary tree)
![信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage](/img/f0/0f985425bd61d9852af0b5fd7307ee.png)
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage

CADD课程学习(7)-- 模拟靶点和小分子相互作用 (半柔性对接 AutoDock)

如何形成规范的接口文档

走入并行的世界

95后阿里P7晒出工资单:狠补了这个,真香...
随机推荐
sun.misc.BASE64Encoder报错解决方法[通俗易懂]
Autumn byte interviewer asked you any questions? In fact, you have stepped on thunder
leetcode刷题:二叉树14(左叶子之和)
【数字IC验证快速入门】7、验证岗位中必备的数字电路基础知识(含常见面试题)
Securerandom things | true and false random numbers
DP:树DP
Leetcode skimming: binary tree 16 (path sum)
Guidelines for application of Shenzhen green and low carbon industry support plan in 2023
mongodb基操的练习
Unity editor extended UI control
信息学奥赛一本通 1340:【例3-5】扩展二叉树
leetcode刷题:二叉树10(完全二叉树的节点个数)
Rainbond 5.7.1 支持对接多家公有云和集群异常报警
[quick start of Digital IC Verification] 7. Basic knowledge of digital circuits necessary for verification positions (including common interview questions)
js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
Unity编辑器扩展 UI控件篇
Leetcode brush question: binary tree 13 (the same tree)
ICTCLAS word Lucene 4.9 binding
什么是pyc文件
About the priority of Bram IP reset