node-red-contrib-kissdb
Version:
A lightweight JSON-based database node for Node-RED
50 lines (32 loc) ⢠1.43 kB
Markdown
## š¦ Example Flows
The [`examples/`](./examples) folder contains two demonstration flows for the `kissdb` node, showcasing both persistent file-based usage and volatile in-memory operation.
### š¹ `KISSDB-BASIC.json`
This flow demonstrates all supported operations on a persistent JSON file (`/data/KissDBTest.json`):
- `CREATE`: initialize the database
- `INSERT`: add a record
- `FIND`, `UPDATE`, `DELETE`: standard CRUD operations
- `COUNT`, `ADD`, `RENAME`, `REMOVE`: structural manipulation
- `VALIDATE`: enforce required fields
- `EXPORTJSON`, `EXPORTCSV`: selective export
- `FILTERBYDATERANGE`, `COUNTBYGROUP`, `SUMBYDATERANGE`: time-based filtering and aggregation
š Ideal for functional testing and file system integration.
---
### š¹ `KISSDB_in_Memory.json`
This flow uses `kissdb` in **volatile mode**, without direct disk writes:
- The database is created and stored in `flow.KISSDB`
- Changes are monitored and written to file only when needed
- Uses `flow.set`, `flow.get`, and `change` nodes to manage state
š Useful for temporary environments, lightweight testing, or simulations.
---
### š„ How to Import
To import an example into Node-RED:
1. Open the Node-RED editor
2. Go to **Menu ā Import ā Clipboard**
3. Paste the contents of the `.json` file
4. Click **Import**
---
### š File Structure
```bash
examples/
āāā KISSDB-BASIC.json
āāā KISSDB_in_Memory.json