Collection
Collection methods and properties.
Description
The Collection object gives ways to query or create collection documents.
Collections exist as top-level objects in the FQL global namespace.
A Collection
object is analogous to a table in a relational database.
Each collection has a collection definition document stored in a
Fauna database and has properties and methods to
query, create, or change documents in the collection.
See the Aliasing section on collection naming.
Document definition |
|
Index definition |
|
Constraint definitions |
|
Computed field definition |
Static methods
Method | Description |
---|---|
Dynamically get the Collection by name. |
|
Get the set of all accessible Collection objects. |
|
Get a Collection document by its name. |
|
Create a Collection. |
|
Get the first matching accessible Collection. |
|
Get the name of the Collection collection as a string. |
|
Get the set of accessible Collections in the database. |
Instance methods
Method | Description |
---|---|
Get the set of all documents in the Collection. |
|
Get a document by its document ID. |
|
Create a document in the Collection. |
|
Create a document in the Collection with a data field. |
|
Delete the Collection instance. |
|
Test if a Collection exists. |
|
Get the first matching accessible document in the Collection. |
|
Replace the existing fields with the provided fields. |
|
Add the provided fields to the existing fields. |
|
Get the set of matching accessible documents in the Collection. |
|
Get the Set of matching documents in the defined Collection index. |
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!