CroxyDB
What's new in 0.0.11?
- Fixed typings.
- Fixed some bugs.
- Added dot notation to MongoDB adapter.
- Added "Moving JsonDB values to MongoDB" function.
Examples
(QuickDB) Moving Everything to CroxyDB
const db = require("croxydb");
const quickdb = require("quick.db");
db.move(quickdb)
(JsonDB) Moving Everything to MongoDB
const db = require("croxydb");
db.setAdapter("mongo", {url: "YOUR_MONGO_URL"})
const JsonDB = require("../your_file.json");
db.moveToMongo(JsonDB)
Example
const db = require("croxydb")
db.set("x.y.z", "abc")
db.get("x")
db.fetch("x")
db.all()
db.push("a", "hello")
db.push("a", "world")
db.unpush("a", "hello")
db.push("b", {test: "croxydb"})
db.push("b", {test2: "croxydb2"})
db.delByPriority("b", 1)
db.setByPriority("b", {newtest:"hey this is edited"}, 1)
db.has("x")
db.delete("x")
db.deleteAll()
MongoDB Support (It is new feature, if you find any bugs join my Discord)
const db = require("croxydb")
db.setAdapter("mongo",
{
url: "Your Mongo URL",
schema: "Schema Name"
})
db.set("x.y.z", "abc")
db.get("x")
db.fetch("x")
db.all()
db.push("a", "hello")
db.push("a", "world")
db.unpush("a", "hello")
db.push("b", {test: "croxydb"})
db.push("b", {test2: "croxydb2"})
db.delByPriority("b", 1)
db.setByPriority("b", {newtest:"hey this is edited"}, 1)
db.has("x")
db.delete("x")
db.deleteAll()
Example With Options
const db = require("croxydb")
db.setReadable(true)
db.noBlankData(true)
db.setAdapter("yamldb")
db.setFolder("folder")
db.setFile("db")
db.set("x.y.z", "abc")
db.get("x")
db.fetch("x")
db.all()
db.push("a", "hello")
db.push("a", "world")
db.unpush("a", "hello")
db.push("b", {test: "croxydb"})
db.push("b", {test2: "croxydb2"})
db.delByPriority("b", 1)
db.setByPriority("b", {newtest:"hey this is edited"}, 1)
db.has("x")
db.delete("x")
db.deleteAll()
If you've any question, you can join to my Discord server: Click me!