The db.createCollection() helper has some optional collection options which get set to undefined if they are not provided. This causes mongodump to output undefined elements which can cause mongorestore to fail.
The documents have the form:
{ "options" : { "create" : "coll", "capped" :
{ "$undefined" : true }, "size" :
{ "$undefined" : true }}, "indexes" : [ { "v" : 1, "key" :
{ "_id" : 1 }, "ns" : "test.coll", "name" : "id" } ] }
- depends on
-
SERVER-7104 jsonString has incorrect output on undefined BSON elements.
- Closed
- is duplicated by
-
SERVER-8408 mongodump dumps a collection with capped in metadata when it's not (anymore)
- Closed
- is related to
-
TOOLS-1699 3.4.5 Server causing crash in extended_json_metadata.js
- Closed
-
TOOLS-1718 duplicate top level key: create
- Closed
-
TOOLS-1934 duplicate top level key: create
- Accepted
- related to
-
SERVER-9182 mongorestore won't restore manually edited .metadata.json file if user editor adds trailing newline
- Closed
-
SERVER-13737 CollectionOptions parser should skip "size"/"max" elements if values non-numeric
- Closed
-
SERVER-13968 Report invalid collection options in "<db>.system.namespaces" in upgrade checker
- Closed