With Node.js we can use a variety of database engines such as MySQL, Postgres, MongoDB, and so on. At a very high level, most databases offer the following four types of operations:

For ease-of-use purposes, we will be using a simple database called nedb. nedb is a MongoDB compatible in-memory or on disk datastore that is quick and easy for us to work with without going through a big setup process.

In order to use it, we have to install it as we would any normal server side node module:

npm install --save nedb

Below is a quick reference to show you how to create a new database, as well as how the four types of operations mentioned above work. See the nedb documentation for more.

Creating a database

Insert

Find