.create()
Creates a record in the database.
Method Syntaxdb.create(thing, data)
Arguments | Description | ||
---|---|---|---|
thing required | The table name or a | ||
data optional | The document / record data to create. |
# Create a record with a random ID person = db.create('person') # Create a record with a specific ID person = db.create(RecordID('person', 'tobie'), { "name": 'Tobie', "settings": { "active": True, "marketing": True, } })
This function will run the following query in the database.
CREATE $thing CONTENT $data