Link Search Menu Expand Document

Quickstart

This quickstart shows you how to set up Cloud Firestore, add, read, update and delete data by using the FireO.

Table of contents

  1. Set up authentication
  2. Add data
  3. Getting Data
  4. Update Data
  5. Delete Data

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});

Copyright © 2019 FireO All rights reserved. Powered by OctaByte