I would like to load a random document out of a set of documents stored in a CouchDB database. The method for picking and loading the document should conform to the following re
If insert performance is not an issue you could try to make number non random e.g. make it doc_count + 1 at the time of creation. Then you could look it up with a random number 0 <= r < doc_count. But that would either require to synchronize the creation of documents or have sequence external to couchdb, e.g. an SQL database.
Best regards
Felix