✨Database powered by localStorage
We’ll start by setting up a database:
const lsdb = new Lsdb("lsdb")
lsdb.collection(["categories", "articles"])
lsdb.insert("categories", { data: { title: "Drinks" } })
lsdb.insert("categories", { data: { title: "Dinner" } })
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 },
},
})
Remove a single document matching the query
lsdb.delete("categories", {
where: {
_id: { $eq: 1 },
},
})
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!