MongoDB 嵌套对象字段深度限制 [英] MongoDB nested Object field depth limit

查看:35
本文介绍了MongoDB 嵌套对象字段深度限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们有以下 JavaScript 对象:

If we have the following JavaScript object:

var obj = {

  field: {
           field: {
                    field: {
                              field: {...}
                            }
                  }
          }
          }

MongoDB 能走多远?

how deep can MongoDB go?

推荐答案

按照官方文档 MongoDB 支持 BSON 文档的 100 级嵌套.除此之外,单个文档的大小限制为 16 兆字节.

In accordance with the official documentation MongoDB supports 100 levels of nesting for BSON documents. Beside this there's a size limitation for a single document which is 16 megabytes.

如果您有兴趣存储更大的文档,您应该阅读 GridFS.

If you are interested in storing larger documents you should read about GridFS.

这篇关于MongoDB 嵌套对象字段深度限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆