{"id":8119,"date":"2015-11-26T13:55:49","date_gmt":"2015-11-26T13:55:49","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/26\/get-random-docs-from-pouchdb-or-couchdb-open-source-projects-pouchdb-pouchdb\/"},"modified":"2022-08-30T15:03:00","modified_gmt":"2022-08-30T15:03:00","slug":"get-random-docs-from-pouchdb-or-couchdb-open-source-projects-pouchdb-pouchdb","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/26\/get-random-docs-from-pouchdb-or-couchdb-open-source-projects-pouchdb-pouchdb\/","title":{"rendered":"Get random docs from PouchDB (or CouchDB)-open source projects pouchdb\/pouchdb"},"content":{"rendered":"<p>I&#8217;m designing a quiz app with Angular and Ionic. I have about 2000 questions in json format and I choose PouchDB as database. CouchDB is perfect for me: I can add new question on a server and app auto update question and answer.<\/p>\n<p>But I have a doubt now: I cannot find a way to get random docs from Pouch. With my app I will generate quizzes from some selected section and I must get a variable number of docs from my DB.<\/p>\n<p>I&#8217;m using the <code>db.allDocs([options], [callback])<\/code> api, I can set a limit but I cannot find a way to get random doc.<\/p>\n<p>Is there any solution?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m designing a quiz app with Angular and Ionic. I have about 2000 questions in json format and I choose PouchDB as database. CouchDB is perfect for me: I can add new question on a server and app auto update question and answer. But I have a doubt now: I cannot find a way to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8119","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8119"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8119\/revisions"}],"predecessor-version":[{"id":8606,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8119\/revisions\/8606"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}