4

If we have the following JavaScript object:

var obj = {

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

how deep can MongoDB go?

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

1 Answers1

7

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.

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

Daniel Olszewski
  • 13,995
  • 6
  • 58
  • 65