mongodb - Importing Backup Collections with mGo -


i have bson export mongodump, , have json export mongoexport

what easiest way import mgo? mgo support inserting backed-up bson collection?

or need use json export, unmarshal , insert() mgo?

thing don't want have specify scheme in go file - want dump file database.

what easiest way import mgo?

easiest? shell out mongorestore go program. boom, done.

does mgo support inserting backed-up bson collection?

i don't see first-class support it. (you email author). should possible, may bit of work. should able use mgo bson layer load *.bson files , insert them db. you'll have parse *.metadata.json files indexes, etc. seems lot of work. (basically rewriting mongorestore.)

or need use json export, unmarshal , insert() mgo?

that slower, , you'd have test $date , $oid handled correctly, seems should work. might simpler write because don't have learn bson layer.


Comments