I found, that to select random document, I need to use $sample
command:
// Get one random document from the mycoll collection.
db.mycoll.aggregate(
{ $sample: { size: 1 } }
)
but what if I need to filter documents and THEN take random one?
I am processing documents, which are not processed yet with
query = {'start_time': {'$exists': False}}
hp_entries = mongo.hyperparameters_collection.find(query)
How would I do with random?