spikie.db
v1.0.1
Published
<div align="center">
Downloads
1
Readme
Installation
$ npm install spikie.db
Example
spikieDB
1. Importing the package
const { spikieDB } = require("spikie.db"); // or import { spikieDB } from "spikie.db";
2. Establishing and exporting spikieDB
const db = new spikieDB({ uri: "your mongodb connection string", }); module.exports = db;
3. Example on using it
const 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