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 56 times
2 Answers
2
Try this:
db.firstColllection.aggregate([
{$limit: 10},
{$out: "secondCollection"}
])
Radosław Miernik
- 3,834
- 8
- 35
- 35
gaurav singh
- 1,346
- 13
- 23