1.1.92 • Published 3 months ago

bsonicdb v1.1.92

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

BsonicDB

=========

BsonicDB is a lightweight, high-performance, caching-based NoSQL database designed for efficient read and write operations. This database is optimized for both small and large data sets and supports various essential database operations like insert, update, find, and delete.

Features

  • Fast read/write performance.
  • Efficient in-memory caching with configurable durations.
  • Supports inserting, updating, deleting, and finding documents.
  • Bulk insert operations (insertMany).
  • Easily integrated into Node.js applications.

Installation

To install BsonicDB, run the following command:

npm install bsonicdb

Usage

Here's an example of how to use BsonicDB:

const BsonicDB = require('bsonicdb');

// Initialize the database with path and caching options
const db = new BsonicDB({
  path: './data',
  cacheDuration: 100, // Caches data for 100 milliseconds before writing to disk
});

// Initialize the database
db.initialize().then(async () => {
  console.log('BsonicDB Initialized!');

  // Insert a document into a collection
  await db.insert('users', { name: 'John', age: 30 });

  // Insert multiple documents into a collection
  await db.insertMany('users', [
    { name: 'Alice', age: 25 },
    { name: 'Bob', age: 28 }
  ]);

  // Find documents in a collection
  const allUsers = await db.find('users', {});
  console.log('All Users:', allUsers);

  // Find specific documents with a query
  const youngUsers = await db.find('users', { age: { $lt: 30 } });
  console.log('Young Users:', youngUsers);

  // Update a document
  await db.update('users', { name: 'John' }, { age: 31 });

  // Delete a document
  await db.delete('users', { name: 'Bob' });

  // Clear the entire collection
  await db.clear('users');
});
1.1.9

3 months ago

1.1.8

3 months ago

1.1.92

3 months ago

1.1.91

3 months ago

1.1.75

4 months ago

1.1.81

3 months ago

1.1.83

3 months ago

1.1.82

3 months ago

1.1.74

4 months ago

1.1.73

4 months ago

1.1.7

4 months ago

1.1.6

4 months ago

1.1.5

4 months ago

1.1.72

4 months ago

1.1.71

4 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago