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"})).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)); }) .catch(console.log);