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
Post a Comment