문제

I have an existing MongoDB dump and I would like to cherry pick some of the data to a clean DB.

Is dumping a single collection and restoring them (mongodump & mongorestore) the way to do this?

도움이 되었습니까?

해결책

You can to this by using the --filter '<JSON>' option on mongorestore.

That's like the first argument of db.find().

If you just want to filter by collection --collection <collection>

See more info in the doc

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top