python - Getting a random document from MongoDB using MongoAlchemy -


i attempting fetch random document api call , can't find suitable solution it. guessing first need find amount of documents in collection , randomly select 1 of them?

app.config['mongoalchemy_database'] = mongodb_db app.config['mongoalchemy_connection_string'] = mongodb_connection_string db = mongoalchemy(app)  class randomdoc(db.document)  ??? 

can 1 nudge me recommended solution?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -