@meanii/tinydb
v0.1.0
Published
tinydb is something, which you can use for as local non-sql database
Downloads
17
Readme
tinydb 💫
tinydb is json database, which you can use for as local non-sql database.
installtion
yarn add @meanii/tinydb
How to init it?
import { Tinydb } from "@meanii/tinydb";
const db = new Tinydb(`touka.ssh`);
class ToukaStorage extends Tinydb {
constructor() {
super(`touka.ssh`)
}
}
const db = new ToukaStorage()
methods
insertOne
await db.insertOne({username: `meanii`})
findOne
const data = await db.findOne({username: `meanii`})
console.log(data)
{
username: 'meanii',
uuid: 'd95f3826-f82a-4944-9d56-df28740009f0',
createdAt: '2022-11-05T11:12:05.196Z',
updatedAt: '2022-11-05T11:12:05.196Z'
}
deleteMany
await db.deleteMany({ username: `meanii` })
findOneAndUpdate
await db.findOneAndUpdate({ username: `meanii` }, { status: `updated` })
Copyright & License
- Copyright (C) 2022 anil chauhan
- Licensed under the terms of the MIT License