dreamdb
2.2.2 • Public • Published
Example
const Schema = require("../src/Schema.js");
const Database = require("../src/database.js")
const db = new Database({
directory: "./databases"
})
const schema = new Schema(db, "users", {
name: {
type: String,
default: "lol"
},
age: {
type: Number,
default: 5
},
})
setTimeout(async function() {
/*
await schema.create({
name: "hello2",
_id: "dr9oe",
age: 45
})
await schema.save()
*/
/*
await schema.update("dre", {
name: "hiio"
})
await schema.save()
*/
//await schema.delete("dr")
/*
let id = await schema.find({age: 10, name: "hello"})
console.log(id)
*/
/*let id = await schema.findById("dre")
console.log(id)
*/
}, 10);
Package Sidebar
Install
Weekly Downloads