当前位置:网站首页>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")
]
}
]);
边栏推荐
- Rainbond 5.7.1 支持对接多家公有云和集群异常报警
- 信息学奥赛一本通 1340:【例3-5】扩展二叉树
- Oracle tablespace management
- Jvmrandom cannot set seeds | problem tracing | source code tracing
- When JS method passes long type ID value, precision loss will occur
- ICTCLAS word Lucene 4.9 binding
- What is PyC file
- js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
- 点云文件的.dat文件读取保存
- 本季度干货导航 | 2022年Q2
猜你喜欢

ROS2专题【01】:win10上安装ROS2
![[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design](/img/92/7af0db21b3d7892bdc5dce50ca332e.png)
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design

leetcode刷题:二叉树13(相同的树)

微信小程序正则表达式提取链接

14. Users, groups, and permissions (14)

无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...

Oracle-表空间管理

Leetcode brush question: binary tree 13 (the same tree)

秋招字节面试官问你还有什么问题?其实你已经踩雷了

Wechat applet regular expression extraction link
随机推荐
Cocos2d-x项目总结中的一些遇到的问题
信息学奥赛一本通 1338:【例3-3】医院设置 | 洛谷 P1364 医院设置
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
Wechat applet regular expression extraction link
Is it safe for CICC fortune to open an account online?
leetcode刷题:二叉树11(平衡二叉树)
怎么挑选好的外盘平台,安全正规的?
Go language | 03 array, pointer, slice usage
leetcode刷题:二叉树12(二叉树的所有路径)
点云文件的.dat文件读取保存
【数字IC验证快速入门】3、数字IC设计全流程介绍
Leetcode(695)——岛屿的最大面积
July 4, 2022 - July 10, 2022 (UE4 video tutorial MySQL)
mongodb/文档操作
死信队列入门(两个消费者,一个生产者)
Leetcode skimming: binary tree 17 (construct binary tree from middle order and post order traversal sequence)
Four methods of random number generation | random | math | threadlocalrandom | securityrandom
USACO3.4 “破锣摇滚”乐队 Raucous Rockers - DP
C language OJ gets PE, OJ of ACM introduction~
kubernetes资源对象介绍及常用命令(五)-(ConfigMap&Secret)