aneeshrelan / lsdb

✨Database powered by localStorage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lsdb

All Contributors

✨Database powered by localStorage

We’ll start by setting up a database:

const lsdb = new Lsdb("lsdb")

Creating list of collections

lsdb.collection(["categories", "articles"])

Inserting

lsdb.insert("categories", { data: { title: "Drinks" } })
lsdb.insert("categories", { data: { title: "Dinner" } })

Getting data

Get all collections

lsdb.all()

Get a list of documents matching the query

lsdb.find("categories", {
    where: {
        title: { $in: ["er"] },
    },
})

Get a single document matching the query

lsdb.findOne("categories", {
    where: {
        _id: { $eq: 1 },
    },
})

Removing

Remove a single document matching the query

lsdb.delete("categories", {
    where: {
    _id: { $eq: 1 },
    },
})

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Aneesh Relan

⚠️ 💻

Zymantas Maumevicius

🚇 💻

Nitkalya Wiriyanuparb

⚠️ 💻

Connor Ruggles

🚇 💻

MAKSS

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

About

✨Database powered by localStorage

License:MIT License


Languages

Language:TypeScript 100.0%