123456789101112131415 |
- var database = require("./db.js");
- // database.init();
- database.put('naaa', {username: "nik"}).
- then(() => database.put('asdad2', {username: "nik2"})).
- then(() => database.put('asdad3', {username: "nik3"})).
- then(() => database.put('asdad4', {username: "nik4"})).
- then(() => database.put('asdad5', {username: "nik5" , test: {deep:1, spec: 2}})).then(function(value){
- return database.get('dasnaaa').catch((e)=>console.log(e.name === "NotFoundError"));
- }).then(console.log).
- then(() => {
- //let a = database.index.createSearchStream(['username', 'nik']).on('data', (a) => console.log(a));
- let a = database.index.createSearchStream(['test', 'deep', 1]).on('data', (a) => console.log(a));
- })
- .catch(console.log);
|