set()

You can create a data and update a data using with set()

Syntax

db.set(path,value,callback?)
  • Path; Path is a string, split with dot and required.

  • Value; All types are acceptable and required.

  • Callback; Callback is a function and not required.

Example

let user = {
    name:"John",
    surname:"Doe",
    age:18
}
db.set("user.john",user,(callback) => {
console.log("Succesfly setted")
console.log(callback)
/*
{
    name:"John",
    surname:"Doe",
    age:18
}
*/
})

If you have not setup check this page 👇

pageSetup

Last updated