This is the ThingsDB documentation for version v0, click here for the latest version!
Create a new collection.
This function generates an event.
new_collection(name)
Argument | Type | Description |
---|---|---|
name | str (required) | Name of the new collection. |
The user who has created the collection will automatically receive full
access rights to the new collection.
Use grant
to give other users access to the collection.
Returns the new collection id
if successful. A lookup_err() is raised
if the collection already exists.
This code will create a collection “awesome_things”:
// Creates a new collection
new_collection('awesome_things');
Example return value in JSON format (the new collection id)
31415