Package Exports
- multiple.db
- multiple.db/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (multiple.db) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
multiple.db
Its Multiple Package store data in JSON format And MongoDB Database!
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