Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB nested Object field depth limit

If we have the following JavaScript object:

var obj = {

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

how deep can MongoDB go?

like image 547
Alexander Mills Avatar asked Feb 11 '23 21:02

Alexander Mills


1 Answers

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.

like image 102
Daniel Olszewski Avatar answered Feb 23 '23 08:02

Daniel Olszewski