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);

Readme

Keywords

Package Sidebar

Install

npm i dreamdb

Weekly Downloads

0

Version

2.2.2

License

ISC

Unpacked Size

7.32 kB

Total Files

8

Last publish

Collaborators

  • crazyboy1234
  • xdreamboy