Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created May 6, 2014 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/f21fe1d37541ac14c186 to your computer and use it in GitHub Desktop.
Save nolanlawson/f21fe1d37541ac14c186 to your computer and use it in GitHub Desktop.
Test PouchDB #2158, IDB data corruption, with PouchDB 2.1.2
<html>
<body>
<script src="//cdn.jsdelivr.net/emberjs/1.5.1/ember.js"></script>
<script src="//cdn.jsdelivr.net/pouchdb/2.1.2/pouchdb.js"></script>
<script src="index.js"></script>
</body>
</html>
var db = new PouchDB('foo');
var map = function(doc){
if(doc.type === 'test'){
emit([doc._id], null);
}
}
db.post({type:'test'}).then(function(){
db.query(map, {}, function(err, result){
if (err) {
console.log(err);
} else {
console.log(result);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment