{"id":8097,"date":"2015-11-26T13:37:52","date_gmt":"2015-11-26T13:37:52","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/26\/using-pouchdb-with-mongodb-open-source-projects-pouchdb-pouchdb\/"},"modified":"2022-08-30T15:03:01","modified_gmt":"2022-08-30T15:03:01","slug":"using-pouchdb-with-mongodb-open-source-projects-pouchdb-pouchdb","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/26\/using-pouchdb-with-mongodb-open-source-projects-pouchdb-pouchdb\/","title":{"rendered":"Using PouchDB with MongoDB-open source projects pouchdb\/pouchdb"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c436dec61b906e27c963518d0ef1d972?s=128&amp;d=identicon&amp;r=PG\" \/> <strong>nlawson<\/strong><\/p>\n<p>PouchDB contributor here. \ud83d\ude42 This is actually a question we get a lot, and it&#8217;s understandable, given the popularity of MongoDB.<\/p>\n<p>The short answer is: no, there&#8217;s no way to get a PouchDB that you can just plug into your existing MongoDB database. You might want to try Meteor.js instead.<\/p>\n<p>The long answer is that CouchDB and MongoDB are not equivalent, and in particular CouchDB is designed from the bottom-up to be used for synchronization. There&#8217;s a good write-up by Jan Lenhardt that explains how it works. Part of the magic of PouchDB\/CouchDB sync comes from this design, which Mongo does not have.<\/p>\n<p>In fact, even if PouchDB used Mongo as a backend (which is not outside of the realm of possibility; we already support Redis and Riak), you would not be able to use your existing database as-is, since PouchDB would need to reconstruct this revision-handling schema over Mongo. Hence you would have to rewrite your app to use the PouchDB\/CouchDB API.<\/p>\n<p><strong>Update:<\/strong> PouchDB will soon support a Mongo-like query language, via the pouchdb-find plugin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>nlawson PouchDB contributor here. \ud83d\ude42 This is actually a question we get a lot, and it&#8217;s understandable, given the popularity of MongoDB. The short answer is: no, there&#8217;s no way to get a PouchDB that you can just plug into your existing MongoDB database. You might want to try Meteor.js instead. The long answer is [&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-8097","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8097","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=8097"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8097\/revisions"}],"predecessor-version":[{"id":8626,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8097\/revisions\/8626"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}