Singleton

Copied!
( ref )

Description

The Singleton function produces a set containing the Reference that you provide.

In most cases, functions cast References into sets when necessary. The only case where Singleton is required is to return a set’s events rather than a Reference's events.

Parameters

Parameter Type Definition and Requirements

ref

A reference to a resource, such as a document, collection, database, etc.

Returns

A new Set Reference for the set which contains the single ref.

Examples

The following query creates a single-item set from the provided ref:

Copied!
((('posts'), '233286601218720256'))
((("posts"), "233286601218720256"))
Query metrics:
  •    bytesIn:  70

  •   bytesOut: 152

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 9ms

  •    retries:   0

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!