Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Query

A Query refers to a query which you can read or listen to. You can also construct refined Query objects by adding filters and ordering.

class Query<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> {
protected constructor();
readonly converter: FirestoreDataConverter<AppModelType, DbModelType> | null;
readonly firestore: Firestore;
readonly type: "query" | "collection";
 
withConverter(converter: null): Query<DocumentData, DocumentData>;
withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): Query<NewAppModelType, NewDbModelType>;
}

§Type Parameters

§
AppModelType = DocumentData
[src]
§
DbModelType extends DocumentData = DocumentData
[src]

§Constructors

§
new Query() protected
[src]

§Properties

§
converter: FirestoreDataConverter<AppModelType, DbModelType> | null
[src]

If provided, the FirestoreDataConverter associated with this instance.

§
firestore: Firestore
[src]

The Firestore instance for the Firestore database (useful for performing transactions, etc.).

§
type: "query" | "collection"
[src]

The type of this Firestore reference.

§Methods

§
withConverter(converter: null): Query<DocumentData, DocumentData>
[src]

Removes the current converter.

@param converter
  • null removes the current converter.
@return

A Query<DocumentData, DocumentData> that does not use a converter.

withConverter<NewAppModelType, NewDbModelType extends DocumentData = DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): Query<NewAppModelType, NewDbModelType>
[src]

Applies a custom data converter to this query, allowing you to use your own custom model objects with Firestore. When you call getDocs with the returned query, the provided converter will convert between Firestore data of type NewDbModelType and your custom type NewAppModelType.

@param converter
  • Converts objects to and from Firestore.
@return

A Query that uses the provided converter.