PouchDB in-memory adapter base fiddle

For all PouchDB related fiddles, use this as a base.

HTML

<script src="//cdn.jsdelivr.net/pouchdb/3.0.6/pouchdb.js"></script>
<script src="https://github.com/pouchdb/pouchdb/releases/download/3.0.6/pouchdb.memory.js"></script>
<div id="logger"></div>

CSS

#logger { font-family: monospace }

JavaScript

var log = function (x) {
  x = JSON.stringify(x)
  document.getElementById('logger').innerHTML += x + "<br>"
}
  
var pouch = PouchDB('test', {adapter: 'memory'})
pouch.on('error', log)

pouch.allDocs().then(log)
pouch.put({_id: 'y', _rev: 'null', raw: 'raw'}).then(log).catch(log)

pouch.put({_id: 'y', _rev: 'null', raw: 'raw'}).then(log).catch(log)