Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test PouchDB #2158, IDB data corruption (with AngularJS)
<html>
<body>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script src="//cdn.jsdelivr.net/pouchdb/2.2.0/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