1.0.3 • Published 5 years ago

nengoose v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Nengoose

This is a ODM wrapper for nedb.

first-timers-only Open Source Love MIT Licence

Motivation

The goal of this open source project is to create a nedb wrapper like mongoose.

Getting started

Run npm install nengoose into your project

Connecting to the database

First, we need to define a connection. If your app uses only one database, you should import the package. If you need to create additional connections, just create a new variable to contain the connection.

const database = require('nengoose');

const User =  new database("path/to/db");

Defining a schema

To create a database schema we will have to

const User = new database("path/to/db");

const user = User.Schema({
    user: {
        type: String
    },
    password: {
        type: String
    },
    address: {
        type: Array
    }
});