Skip to content
Permalink
Newer
Older
100644 15 lines (15 sloc) 404 Bytes
1
// Create a new document and specify its ID
2
var db = new PouchDB("smart-meter");
3
console.log("Local database created");
4
db.put({
5
_id: "2014-11-12T23:27:03.794Z",
6
kilowatt_hours: 14
7
}).then(function() {
8
console.log("Document created");
9
// Delete the database
10
return db.destroy();
11
}).then(function() {
12
console.log("Local database deleted");
13
}).catch(function(error) {
14
console.log(error);
15
});