MongoDB Bson文档深度

时间:2017-08-11 12:46:49

标签: mongodb mongodb-query

在MongoDB 3.4文档中提到了

  

MongoDB支持不超过100级的BSON文档嵌套

但是我能够插入超过100个级别的文档,那么我对文档嵌套的理解是错误的吗?我在这里缺少什么可以请任何人指出? 下面是两个存储的文件:

  

db.check.find()

     

{" _id" :ObjectId(" 598da4250de4a665225f2741")," k1" :{" k2" :{" k3"   :{" k4" :{" k5" :{" k6" :{" k7" :{" k8" :{" k9" :{" k10" :{   " K11" :{" k12" :{" k13" :{" k14" :{" k15" :{" k16" :{" k17" :{   " K18" :{" k19" :{" k20" :{" K21" :{" k22" :{" k23" :{" k24" :{   " K25" :{" k26" :{" k27" :{" k28" :{" k29" :{" k30" :{" k31" :{   " K32" :{" K33" :{" k34" :{" k35" :{" k36" :{" k37" :{" k38" :{   " K39" :{" k40" :{" k41" :{" k42" :{" k43" :{" k44" :{" K45" :{   " K46" :{" k47" :{" k48" :{" k49" :{" k50" :{" k51" :{" k52" :{   " K53" :{" k54" :{" k55" :{" k56" :{" K57" :{" k58" :{" k59" :{   " K60" :{" k61" :{" k62" :{" k63" :{" k64" :{" k65" :{" k66" :{   " K67" :{" k68" :{" K69" :{" k70" :{" k71" :{" k72" :{" k73" :{   " K74" :{" k75" :{" k76" :{" k77" :{" k78" :{" k79" :{" k80" :{   " K81" :{" k82" :{" k83" :{" k84" :{" k85" :{" k86" :{" k87" :{   " K88" :{" k89" :{" k90" :{" k91" :{" k92" :{" K93" :{" k94" :{   " K95" :{" k96" :{" k97" :{" k98" :{" k99" :{" k100" :{" k101" :   "喜" }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}   }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}   }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}      

{" _id" :ObjectId(" 598da502d662e277bf7971b0")," k1" :{" k2" :{" k3"   :{" k4" :{" k5" :{" k6" :{" k7" :{" k8" :{" k9" :{" k10" :{   " K11" :{" k12" :{" k13" :{" k14" :{" k15" :{" k16" :{" k17" :{   " K18" :{" k19" :{" k20" :{" K21" :{" k22" :{" k23" :{" k24" :{   " K25" :{" k26" :{" k27" :{" k28" :{" k29" :{" k30" :{" k31" :{   " K32" :{" K33" :{" k34" :{" k35" :{" k36" :{" k37" :{" k38" :{   " K39" :{" k40" :{" k41" :{" k42" :{" k43" :{" k44" :{" K45" :{   " K46" :{" k47" :{" k48" :{" k49" :{" k50" :{" k51" :{" k52" :{   " K53" :{" k54" :{" k55" :{" k56" :{" K57" :{" k58" :{" k59" :{   " K60" :{" k61" :{" k62" :{" k63" :{" k64" :{" k65" :{" k66" :{   " K67" :{" k68" :{" K69" :{" k70" :{" k71" :{" k72" :{" k73" :{   " K74" :{" k75" :{" k76" :{" k77" :{" k78" :{" k79" :{" k80" :{   " K81" :{" k82" :{" k83" :{" k84" :{" k85" :{" k86" :{" k87" :{   " K88" :{" k89" :{" k90" :{" k91" :{" k92" :{" K93" :{" k94" :{   " K95" :{" k96" :{" k97" :{" k98" :{" k99" :{" k100" :{" k101" :   {" k102" :" hi2" }}}}}}}}}}}}}}}}}}}}}}}}}   }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}   }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}   }}}}}   >

1 个答案:

答案 0 :(得分:0)

MongoDB在推荐的嵌套限制内有一些松弛,硬限制实际上是200个嵌套文档。

请参阅此处 - https://github.com/mongodb/mongo/blob/master/src/mongo/bson/bson_depth.h#L39

有关详细信息,请参阅此Jira项目 - https://jira.mongodb.org/browse/DOCS-10578