Mu
Search
K
💽

Storage

What's a webapp without a database. Mu comes with built in storage so you can build rich apps rapidly.

Getting Started

To add storage to your application, you simply need to call mu.storage with the name of entity you would like to create. This will not create the database, it will simply provide the methods needed to get started.
const todos = mu.storage('todos')
Once called you will then be able to use this to store data within your app.
const todos = mu.storage('todos')
async function createTodo() {
const todo = await todos.create({
todo: 'Create awesome app on Mu',
completed: true,
})
console.log(todo)
}
createTodo()
To create, update or delete any items in our storage will require the user is logged in.

How to list storage items.

Once you have items in your database, you are then able to fetch these with mu.find.
const todos = mu.storage('todos')
async function listTodos() {
const todos = await todos.find()
console.log(todos)
}
listTodos()
By default all reads are public. This means they are not locked to the logged in user, this is good for apps where data is not unique to the user but if you would like to make data private please see permissions.

How to delete an item

(Coming soon)

How to update an item

(Coming soon)