1.2.3 • Published 3 years ago

nedb-repl v1.2.3

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

nedb-repl

The command-line tool for NeDB

npm.io

Build Status Dependency Status devDependency Status

This is an interactive interface to query and update data, like MongoDB Shell, but for NeDB.

Install

npm install -g nedb-repl

Usage

To open a datastore file, use:

$ nedb foo.db

Inside the REPL, the datastore namespace is attached to the db global property.

You can display the datastore you're using by typing:

nedb> db.filename
foo.db

To perform queries and other operations, you can use the well-known NeDB datastore methods without the callback param. See NeDB API.

nedb> db.insert([ { a: 1 }, { a: 2 } ])
{"a":1,"_id":"Kkui4fblZ5kqkmc8"},
{"a":2,"_id":"9ptV45vIEbBparvA"}
nedb> db.find({ a: 1 })
{"a":1,"_id":"Kkui4fblZ5kqkmc8"}
nedb> db.count()
2

You can change the datastore you're using with the .open command:

nedb> .open bar.db
Opened file bar.db

If the filename is not specified, the datastore is set to in-memory only.

You can see other REPL commands by typing .help.

Changelog

1.2.0

  • Automatically execute cursors (no need to put .exec() in the final of each query)

1.1.0

  • Automatically reload datastore when it changes

License

MIT © Nikolas Silva

1.2.3

3 years ago

1.2.2

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago