I found this answer - Answer link
db.full_set.aggregate([ { $match: { date: "20120105" } }, { $out: "subset" } ]);
I want do same thing but with first 15000 documents in collection, I couldn't find how to apply limit to such query (I tried using $limit : 15000
, but it doesn't recognize $limit)
also when I tried -
db.subset.insert(db.full_set.find({}).limit(15000).toArray())
there is no function toArray()
for output type cursor
.
Guide me how can I accomplish it?