MongoDB中文档的最大大小是多少
该文档是集合中的记录。每个文档的大小限制为16MB。文档包裹在大括号({})中。
让我们创建一个包含文档的集合-
> db.demo748.insertOne({_id:101,Name:"Chris",Age:21}); { "acknowledged" : true, "insertedId" : 101 } > db.demo748.insertOne({_id:102,Name:"Bob",Age:20}); { "acknowledged" : true, "insertedId" : 102 } > db.demo748.insertOne({_id:103,Name:"David",Age:23}); { "acknowledged" : true, "insertedId" : 103 } > db.demo748.insertOne({_id:104,Name:"Sam",Age:19}); { "acknowledged" : true, "insertedId" : 104 }
在find()方法的帮助下显示集合中的所有文档-
> db.demo748.find();
这将产生以下输出-
{ "_id" : 101, "Name" : "Chris", "Age" : 21 } { "_id" : 102, "Name" : "Bob", "Age" : 20 } { "_id" : 103, "Name" : "David", "Age" : 23 } { "_id" : 104, "Name" : "Sam", "Age" : 19 }