README
Installation
$ npm install spikie.db
DISCORD.JS
Example
spikieDB
1. Importing the packageconst { spikieDB } = require("spikie.db"); // or import { spikieDB } from "spikie.db";
2. Establishing and exporting spikieDBconst db = new spikieDB({ uri: "your mongodb connection string", }); module.exports = db;
3. Example on using itconst db = require("./db.js"); // replace db.js with your file path to the setup of spikieDB db.set("numbers", "123");
Methods
.set// saves data to database db.set("key", "value");
.get// gets value from key db.get("key"); // returns => value
.has// returns boolean db.has("key"); // returns => true
.delete// deletes data db.delete("key"); // checking for data db.has("key"); // returns => false
const { spikieDB } = require("spikie.db"); // or import { spikieDB } from "spikie.db";
const db = new spikieDB({ uri: "your mongodb connection string", }); module.exports = db;
const db = require("./db.js"); // replace db.js with your file path to the setup of spikieDB db.set("numbers", "123");
// saves data to database db.set("key", "value");
// gets value from key db.get("key"); // returns => value
// returns boolean db.has("key"); // returns => true
// deletes data db.delete("key"); // checking for data db.has("key"); // returns => false