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
Now you can use the aggregate. Example:
db.users.aggregate( [ { $sample: { size: 3 } } ] )
See the doc.