当前位置:网站首页>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")
]
}
]);
边栏推荐
- 信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
- About the priority of Bram IP reset
- Is it safe for Galaxy Securities to open an account online?
- How to retrieve the root password of MySQL if you forget it
- C - sequential structure
- 【数字IC验证快速入门】6、Questasim 快速上手使用(以全加器设计与验证为例)
- 图嵌入Graph embedding学习笔记
- [quick start of Digital IC Verification] 6. Quick start of questasim (taking the design and verification of full adder as an example)
- 淺淺的談一下ThreadLocalInsecureRandom
- Leetcode skimming: binary tree 16 (path sum)
猜你喜欢

14. Users, groups, and permissions (14)
![[quick start of Digital IC Verification] 9. Finite state machine (FSM) necessary for Verilog RTL design](/img/32/a156293f145417eeae8d93c539ca55.png)
[quick start of Digital IC Verification] 9. Finite state machine (FSM) necessary for Verilog RTL design

Hong Kong stocks will welcome the "best ten yuan store". Can famous creative products break through through the IPO?

【数字IC验证快速入门】2、通过一个SoC项目实例,了解SoC的架构,初探数字系统设计流程

【数字IC验证快速入门】8、数字IC中的典型电路及其对应的Verilog描述方法

Leetcode skimming: binary tree 16 (path sum)

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

解决php无法将string转换为json的办法

A way to calculate LNX

关于BRAM IP复位的优先级
随机推荐
95后阿里P7晒出工资单:狠补了这个,真香...
如何形成规范的接口文档
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
股票开户哪里好?网上客户经理开户安全吗
.Net分布式事务及落地解决方案
Is it safe for Guosen Securities to open an account online?
Mysql频繁操作出现锁表问题
[quick start of Digital IC Verification] 1. Talk about Digital IC Verification, understand the contents of the column, and clarify the learning objectives
Summer Challenge harmonyos - realize message notification function
图嵌入Graph embedding学习笔记
Scala basics [HelloWorld code parsing, variables and identifiers]
Leetcode skimming: binary tree 16 (path sum)
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
mongodb文档间关系
js实现禁止网页缩放(Ctrl+鼠标、+、-缩放有效亲测)
【数字IC验证快速入门】7、验证岗位中必备的数字电路基础知识(含常见面试题)
浅浅的谈一下ThreadLocalInsecureRandom
ICTCLAS用的字Lucene4.9捆绑
Ffplay document [easy to understand]
Hong Kong stocks will welcome the "best ten yuan store". Can famous creative products break through through the IPO?