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
In Python using pymongo:
import random def get_random_doc(): count = collection.count() return collection.find()[random.randrange(count)]