I have got mongo db called test and in this db two collections collection1 and collection1_backup. How to replace content of col
test
collection1
collection1_backup
col
simply just do this.
//drop collection1
db.collection1.drop();
//copy data from collection1_backup to collection1
db.collection1.insert(db.collection1_backup.find({},{_id:0}).toArray());