I have two collections , one where all documents are stored and the other where the documents will be stored after processing. I am new with mongo and would like to know if there is any method to copy the documents from one collection to the other ?
Asked
Active
Viewed 95 times
2 Answers
2
Try this:
db.firstColllection.aggregate([
{$limit: 10},
{$out: "secondCollection"}
])

Radosław Miernik
- 4,004
- 8
- 33
- 36

gaurav singh
- 1,376
- 1
- 15
- 25