Tutorial by Examples

It's very easy to install nedb. npm install nedb --save # Put latest version in your package.json For bower loving people, bower install nedb
While building electron apps, usually the backend is in separate folder (js files) and front end is in a separate folder (html files). In the backend, in order to use the database, we have to include the nedb package with the require statement as follows. var Datastore = require('nedb'),db = new Da...
Basically, in order to insert records to nedb, the data is stored in the form of json with the key being the column names and the value for those names will be the values for that record. var rec = { name: 'bigbounty',age:16}; db.insert(rec, function (err, newrec) { // Callback is optional ...
In order to search for records in nedb, again we need to just pass the json containing the search criteria as a parameter to the find function of db object. db.find({ name: 'bigbounty' }, function (err, docs) { // docs is an array containing documents that have name as bigbounty // If no docu...
In order to remove documents in nedb, it's very easy. We just have to use remove function of db object. db.remove({ name: 'bigbounty' }, function (err, numremoved) { // numremoved is the number of documents that are removed. });

Page 1 of 1