Ordering class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents an ordering criterion for sorting documents in a Firestore pipeline.

You createOrdering instances using theascending anddescending helper functions.

Signature:

exportdeclareclassOrdering

Constructors

ConstructorModifiersDescription
(constructor)(expr, direction, _methodName)(Public Preview) Constructs a new instance of theOrdering class

Properties

PropertyModifiersTypeDescription
direction'ascending' | 'descending'(Public Preview)
exprExpression(Public Preview)

Ordering.(constructor)

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Constructs a new instance of theOrdering class

Signature:

constructor(expr:Expression,direction:'ascending'|'descending',_methodName:string|undefined);

Parameters

ParameterTypeDescription
exprExpression
direction'ascending' | 'descending'
_methodNamestring | undefined

Ordering.direction

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

readonlydirection:'ascending'|'descending';

Ordering.expr

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

readonlyexpr:Expression;

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-15 UTC.