db6nodejs
v5.4.0
Published
Node.js client for db6 database with REST support
Readme
db6nodejs
Node.js client for db6 database with REST support.
Installation
npm install db6nodejsQuick Start
import { Client } from 'db6nodejs';
// Create client
const db = new Client('http://localhost:50052');
// Health check
await db.health();
// Key-Value operations
await db.put(1, 'key', 'value');
const [value, found] = await db.get(1, 'key');
// Batch operations
await db.batchPut(1, [['k1', 'v1'], ['k2', 'v2']]);
const results = await db.scan(1, 'k', 'k\xff');
// Statistics
const stats = await db.stats();
// Delete
await db.delete(1, 'key');API Reference
new Client(baseUrl, options?)
baseUrl: Base URL of db6 server (e.g., 'http://localhost:50052')
Methods
health()-> Promiseput(tableId, key, value)-> Promiseget(tableId, key)-> Promise<[value, found]>delete(tableId, key)-> PromisebatchPut(tableId, items)-> Promisescan(tableId, startKey, endKey)-> Promise<Array<[key, value]>>stats()-> PromiserangeDelete(tableId, startKey, endKey)-> Promiseclose()-> Promise
License
MIT
