Class: CollectionReference

ReactiveDb.CollectionReference

Represents a handle on a collection (of documents) of the ReactiveDb service.

Instances of this class are built using the ReactiveDb#col factory method.

Members

(readonly) collectionId :string

Identifier of the collection referred to by this instance.

Type:
  • string

Methods

doc(documentId) → {ReactiveDb.DocumentReference}

Gets a reference to a document within the collection referred to by this instance.

Parameters:
Name Type Description
documentId string

the document identifier within the collection

Returns:
Type
ReactiveDb.DocumentReference

limit(n) → {ReactiveDb.Projectable}

Builds a new Queryable instance that will match a maximum number of documents.

Parameters:
Name Type Description
n number

The maximum number of documents to match.

Implements:
Returns:

The resulting Queryable instance may be further specialized using methods of the Projectable interface.

Type
ReactiveDb.Projectable

sortingAsc(field) → {ReactiveDb.SortableSorting|ReactiveDb.Limitable|ReactiveDb.Projectable}

Requests an ascending sorting order on a given document field.

Parameters:
Name Type Description
field ReactiveDb.DocumentField

The document field, which to sort on.

Implements:
Returns:

The resulting Queryable instance may be further specialized using methods of the SortableSorting (to add sort directives), Limitable and Projectable interfaces.

Type
ReactiveDb.SortableSorting | ReactiveDb.Limitable | ReactiveDb.Projectable

sortingAscFrom(field, boundary) → {ReactiveDb.SortableSortingFrom|ReactiveDb.Limitable|ReactiveDb.Projectable}

Requests an ascending sorting order on a given document field, and excludes all documents whose value of this field falls short of a given boundary (inclusive). This directive actually mixes sorting and windowing.

Parameters:
Name Type Description
field ReactiveDb.DocumentField

The document field, which to sort on.

boundary ReactiveDb.JSONValue

The minimum value of the document field for documents not to be excluded from the query.

Implements:
Returns:

The resulting Queryable instance may be further specialized using methods of the SortableSortingFrom (to add sort directives), Limitable and Projectable interfaces.

Type
ReactiveDb.SortableSortingFrom | ReactiveDb.Limitable | ReactiveDb.Projectable

sortingDesc(field) → {ReactiveDb.SortableSorting|ReactiveDb.Limitable|ReactiveDb.Projectable}

Requests a descending sorting order on a given document field.

Parameters:
Name Type Description
field ReactiveDb.DocumentField

The document field, which to sort on.

Implements:
Returns:

The resulting Queryable instance may be further specialized using methods of the SortableSorting (to add sort directives), Limitable and Projectable interfaces.

Type
ReactiveDb.SortableSorting | ReactiveDb.Limitable | ReactiveDb.Projectable

sortingDescFrom(field, boundary) → {ReactiveDb.SortableSortingFrom|ReactiveDb.Limitable|ReactiveDb.Projectable}

Requests a descending sorting order on a given document field, and excludes all documents whose value of this field is beyond a given boundary (inclusive). This directive actually mixes sorting and windowing.

Parameters:
Name Type Description
field ReactiveDb.DocumentField

The document field, which to sort on.

boundary ReactiveDb.JSONValue

The maximum value of the document field for documents not to be excluded from the query.

Implements:
Returns:

The resulting Queryable instance may be further specialized using methods of the SortableSortingFrom (to add sort directives), Limitable and Projectable interfaces.

Type
ReactiveDb.SortableSortingFrom | ReactiveDb.Limitable | ReactiveDb.Projectable

where(field, filter) → {ReactiveDb.Filterable|ReactiveDb.Sortable|ReactiveDb.Limitable|ReactiveDb.Projectable}

Builds a new Queryable instance by adding a filter constraint on this Queryable instance.

Parameters:
Name Type Description
field ReactiveDb.DocumentField

Field of the documents this filter constraint applies to.

filter ReactiveDb.Filter

The filter to apply to the given field.

Implements:
Returns:

The resulting Queryable instance may be further specialized using methods of the Filterable, Sortable, Limitable and Projectable interfaces.

Type
ReactiveDb.Filterable | ReactiveDb.Sortable | ReactiveDb.Limitable | ReactiveDb.Projectable
deprecated
Authentication
ServerlessDb
ReactiveDb