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

from fireo.models import Model
from fireo.fields import TextField, NumberField

class User(Model):
    name = TextField()
    age = NumberField()


u = User()
u.name = "Azeem"
u.age = 26
u.save()

print(u.key)

Getting Data

user = User.collection.get(user_key)
print(user.name, user.age)

Update Data

u = User()
u.name = "Arfan"
u.update(user_key)

Delete Data

User.collection.delete(user_key)

Copyright © 2019 FireO All rights reserved. Powered by OctaByte