Skip to content

Instantly share code, notes, and snippets.

@waquner
Last active July 16, 2019 14:49
Show Gist options
  • Save waquner/bfa5aa64c53bbd3c158dcbd7421bc010 to your computer and use it in GitHub Desktop.
Save waquner/bfa5aa64c53bbd3c158dcbd7421bc010 to your computer and use it in GitHub Desktop.
<html>
<body>
<script src="https://cdn.jsdelivr.net/pouchdb/latest/pouchdb.js"></script>
<script>
// Destroy and recreate the database every time the page is reloaded
var db = new PouchDB('testdb');
db.get('blabla.blabla', function(err, doc) {
if(doc){
document.getElementById('d').innerHTML = JSON.stringify(doc);
} else {
db.put({
_id: 'blabla.blabla',
value: {
test: {
test: {
test: new Array(10e5).join('x')
}
}
}
}, function(err, response) {
if (err) {
alert(err);
}
alert(response);
});
}
});
</script>
<div id="d"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment