Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikolvs/nedb-repl
The command-line tool for NeDB
https://github.com/nikolvs/nedb-repl
cli database nedb node nosql repl terminal
Last synced: about 1 month ago
JSON representation
The command-line tool for NeDB
- Host: GitHub
- URL: https://github.com/nikolvs/nedb-repl
- Owner: nikolvs
- License: mit
- Created: 2016-09-25T08:29:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T00:10:14.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T11:15:16.874Z (5 months ago)
- Topics: cli, database, nedb, node, nosql, repl, terminal
- Language: JavaScript
- Size: 605 KB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nedb-repl
> The command-line tool for NeDB![](terminal.gif)
[![Build Status](https://travis-ci.org/nikolvs/nedb-repl.svg)](https://travis-ci.org/nikolvs/nedb-repl)
[![Dependency Status](https://david-dm.org/nikolvs/nedb-repl.svg)](https://david-dm.org/nikolvs/nedb-repl)
[![devDependency Status](https://david-dm.org/nikolvs/nedb-repl/dev-status.svg)](https://david-dm.org/nikolvs/nedb-repl#info=devDependencies)This is an interactive interface to query and update data, like MongoDB Shell, but for NeDB.
## Install
```bash
npm install -g nedb-repl
```## Usage
To open a datastore file, use:
```bash
$ 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:
```bash
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](https://github.com/louischatriot/nedb#api).
```bash
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:
```bash
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](http://nikolas.com.br)