Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rodnye/json-db-client
json-db-server client
https://github.com/rodnye/json-db-client
Last synced: 2 days ago
JSON representation
json-db-server client
- Host: GitHub
- URL: https://github.com/rodnye/json-db-client
- Owner: rodnye
- Created: 2024-03-03T22:44:41.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-03T22:53:35.000Z (11 months ago)
- Last Synced: 2024-11-24T20:46:41.349Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON-db client
A personal NodeJS client to send request and handle [json-db-server](https://github.com/rodnye/json-db-server) databases.## Getting started
### Install
Install the github repository directly in your project:
```
npm install json-db-client@github:rodnye/json-db-client
```### Basic usage
```javascript
const { DatabaseClient } = require("json-db-client");// Change for your json-db-server URL
const client = new DatabaseClient("http://localhost:3000");// Get database
const db = client.db("shop");// Get collections inside them
const users = db.collection("users");
const posts = db.collection("posts");
const products = db.collection("products");// Push something
await users.insertOne({
name: "Ana Cabrera",
genre: "female",
age: 57,
online: true,
});
```