OrderBy class
Creates a condition to order your collection
field must be provided and is normally the string representation of the field on your document to match against.
It's recommended to store field names on your model so you can access them
with MyModel.field<YourField>
where MyModel
references the class you're
serializing your Document into, and field<YourField>
is the naming
convention to follow (don't include the angle brackets).
An OrderBy clause also filters for existence of the given fields. The result set will not include documents that do not contain the given fields.
Constructors
- OrderBy({required String field, OrderDirection direction = OrderDirection.asc})
- OrderBy.docId([OrderDirection direction = OrderDirection.asc])
-
Creates a condition to order your collection by document id
const
Properties
- byId → bool
-
final
- direction → OrderDirection
-
final
- field → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
moveOrCreateMatchingField(
{required String fieldToMatch, required List< OrderBy> ? orderBy, required bool isRangeComparison}) → List<OrderBy> ? -
Handle cases when using
OrderBy
with where clauses containing range comparisons. -
removeEqualtyAndInMatchingFields(
{required List< String> fieldsToMatch, required List<OrderBy> ? orderBy, required bool isEqualityOrInComparison}) → List<OrderBy> ? -
Handle cases when using
OrderBy
with where clauses containing equality or in comparisons.