Collections API
When querying multiple objects via users
, flows
, and table
.
| Return an object associated with the object_id. |
| Return a list of objects matching the filters provided: |
| Update the object's data, but not overwriting other data. |
| Update and overwrite the object completely. |
| Delete the objects. |
| Return a list of all objects for the collection. |
| Add a new objects to the collection. |
self.db.users.get("Uxxxxxxxxx")
{
'id': 'Uxxxxxxxxx',
'name': 'Nikola',
'dob': 'July 10, 1856'
}
self.db.table('products').filter(
price__lt=100,
category='toys'
order_by=['-price', 'name']
)
[
{
"id": "O111111111",
"category": "toys",
"price": 45.12
"name": "Bop-it"
},
{
"id": "O222222222",
"category": "toys",
"price": 15.99
"name": "Bubble mower"
}
]
import time
order = {
'item': 'Fish burrito',
'price': 8.99,
'created_at': time.time(),
'user_id': self.db.user.id
}
id = self.db.table('orders').add(order)
Updated about 1 month ago