mongodb - mongorestore metadata.json file -


i have .bson file mongodb dump. dump produces .metadata.json file seems contain index definitions.

{     "options": {},     "indexes": [         {             "v": 1,             "key": {                 "_id": 1             },             "name": "_id_",             "ns": "test.onemilliondocuments"         }     ] } 

i assume restoring .bson file doesn't include indexes.

  • how use .metadata.json file? need restore separately?

my restore finished following lines:

2016-02-06t19:18:56.397+0000    [#######################.]  test2.onemillionrecordsrestore  9.7 gb/9.7 gb  (99.5%) 2016-02-06t19:18:58.475+0000    restoring indexes collection test2.onemillionrecordsrestore metadata 2016-02-06t19:18:58.485+0000    finished restoring test2.onemillionrecordsrestore (1000000 documents) 2016-02-06t19:18:58.488+0000    done 

there's line saying it's restoring indexes, referencing .metadata.json file.

you don't have specific metadata.json file: run mongorestore , read .bson files provided in same directory. see line in output can infer whether has been read or not:

2016-02-06t20:22:08.652+0100    reading metadata mydb.message dump/mydb/message.metadata.json 

however, think there cases ignored (e.g. conflicting index definitions). import won't fail though, see line in log telling metadata (or parts of it) ignored.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -