I am looking to get a random record from a huge (100 million record) mongodb.
mongodb
What is the fastest and most efficient way to do so? The data is already t
The following aggregation operation randomly selects 3 documents from the collection:
db.users.aggregate( [ { $sample: { size: 3 } } ] )
https://docs.mongodb.com/manual/reference/operator/aggregation/sample/