Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

multiple.db

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiple.db

multiple database mongodb and json

latest
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

multiple.db

Its Multiple Package store data in JSON format And MongoDB Database!

npm

How To Use multiple.db with MongoDB

const db = require('multiple.db'); // npm i multiple.db

// Connect to the database
await db.connect('mongodb://localhost/test')

// Add a value
await db.add('key', 1);

// Subtract a value
await db.subtract('key', 2);

// Set a value
await db.set('key', 'value');

// Delete a value
await db.delete('key');

// Get a value
awiat db.get('key');

// Check if a key exists
const exists = await db.has('key');
console.log(exists); // Output: false

// Get all values
const values = await db.all();
console.log(values); // Output: []

// Fetch a value
const value = await db.fetch('key');
console.log(value); // Output: undefined

// Reset the database
await db.reset();

How To Use multiple.db with JSON format

const db = require('multiple.db'); // npm i multiple.db

// Add a value
await db.add('key', 1);

// Subtract a value
await db.subtract('key', 2);

// Set a value
await db.set('key', 'value');

// Delete a value
await db.delete('key');

// Get a value
awiat db.get('key');

// Check if a key exists
const exists = await db.has('key');
console.log(exists); // Output: false

// Get all values
const values = await db.all();
console.log(values); // Output: []

// Fetch a value
const value = await db.fetch('key');
console.log(value); // Output: undefined

// Reset the database
await db.reset();

Need Help ?

Contact With Me on Discord : devsmsm

Contact With Me on Instrgram : u9fxc

Keywords

multiple.db

FAQs

Package last updated on 03 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts