Quickstart
This quickstart shows you how to set up Cloud Firestore, add, read, update and delete data by using the FireO.
Table of contents
Set up authentication
To run the client library, you must first set up authentication
Add data
const {Model, Field} = require("fireo")
class User extends Model {
name = Field.Text();
age = Field.Number();
}
const u = User.init();
u.name = "Azeem";
u.age = 26;
await u.save();
console.log(u.key)
Getting Data
const user = await User.collection.get({key: user_key});
console.log(user.name, user.age)
Update Data
const u = User.init();
u.name = "Arfan";
u.update(user_key);
Delete Data
await User.collection.delete({key: user_key});