|
@@ -0,0 +1,17 @@
|
|
|
+var database = require("./db.js");
|
|
|
+database.init();
|
|
|
+// database.put('namezzzzzz', {asd: "gdfhdfh"}, function (err) {
|
|
|
+// if (err) return console.log('Ooops!', err) // some kind of I/O error
|
|
|
+
|
|
|
+// // 3) Fetch by key
|
|
|
+// database.get('namezzzzzz', function (err, value) {
|
|
|
+// if (err) return console.log('Ooops!', err) // likely the key was not found
|
|
|
+
|
|
|
+// // Ta da!
|
|
|
+// console.log('name is=' + JSON.stringify(value))
|
|
|
+// })
|
|
|
+// })
|
|
|
+
|
|
|
+database.put('namezzzzzz', {asd: "gdfhdfh"}).then(function(value){
|
|
|
+ return database.get('namezzzzzz');
|
|
|
+}).then(console.log);
|