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. Each collection object has a collection definition document stored in a Fauna database and has properties and methods that give ways to query, create, or mutate documents present in the collection.

See the Aliasing section on collection naming.

Document definition

Index definition

Static methods

Method Description

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 Set of accessible collections in the database.

Instance properties

Property Description

Get the collection document.

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.

Test if a collection exists.

Get the first matching accessible document in the collection.

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!