CroxyDB
What's new in 0.0.26?
- You can now reduce down to - in the "db.subtract" function.
Examples
(QuickDB) Moving Everything to CroxyDB
const db = require("croxydb");
const quickdb = require("quick.db");
await db.move(quickdb)
(JsonDB) Moving Everything to MongoDB
const db = require("croxydb");
db.setAdapter("mongo", {url: "YOUR_MONGO_URL", Schema: "Schema Name"})
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"
})
await db.set("x.y.z", "abc")
await db.get("x")
await db.fetch("x")
await db.all()
await db.push("a", "hello")
await db.push("a", "world")
await db.unpush("a", "hello")
await db.push("b", {test: "croxydb"})
await db.push("b", {test2: "croxydb2"})
await db.delByPriority("b", 1)
await db.setByPriority("b", {newtest:"hey this is edited"}, 1)
await db.has("x")
await db.delete("x")
await 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.setCheckUpdates(true)
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!