Created
May 6, 2014 00:43
-
-
Save nolanlawson/47e481e8932030d2d818 to your computer and use it in GitHub Desktop.
Test PouchDB #2158, IDB data corruption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script src="//cdn.jsdelivr.net/emberjs/1.5.1/ember.js"></script> | |
<script src="//cdn.jsdelivr.net/pouchdb/2.2.0/pouchdb.js"></script> | |
<script src="index.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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