Insert data

Here's how you insert data into your JSON file

let data = { username: "Vito Corleone", type: "Human" }
db.insert(data)
    .then((d) => {
        // do something else
    })

Simple right? You can also insert multiple objects at once like this

let data = [
    { username: "Tom Hagen", type: "Human", profession: "Lawyer" },
    { username: "Micheal Corleone", type: "Human" },
]

db.insert(data)
    .then((d) => {
        // do something else
    })

results matching ""

    No results matching ""