@@ -127,19 +127,20 @@ export function query<T>(
127
127
}
128
128
129
129
/**
130
- * A `QueryFilterConstraint` is used to narrow the set of documents returned by a
131
- * Firestore query by filtering on one or more document fields. `QueryFilterConstraint`s are created by invoking { @link where},
132
- * {@link or} or {@link and} and
133
- * can then be passed to {@link query} to create a new query instance that
134
- * also contains this `QueryFilterConstraint`.
130
+ * A `QueryFilterConstraint` is used to narrow the set of documents returned by
131
+ * a Firestore query by filtering on one or more document fields.
132
+ * `QueryFilterConstraint`s are created by invoking {@link where}, {@link or} or
133
+ * { @link and} and can then be passed to {@link query} to create a new query
134
+ * instance that also contains this `QueryFilterConstraint`.
135
135
*/
136
136
export abstract class QueryFilterConstraint extends QueryConstraint {
137
137
abstract _parse < T > ( query : Query < T > ) : Filter ;
138
138
}
139
139
140
140
/**
141
- * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by a
142
- * Firestore query by filtering on one document field. `QueryFieldFilterConstraint`s are created by invoking {@link where} and
141
+ * A `QueryFieldFilterConstraint` is used to narrow the set of documents
142
+ * returned by a Firestore query by filtering on one document field.
143
+ * `QueryFieldFilterConstraint`s are created by invoking {@link where} and
143
144
* can then be passed to {@link query} to create a new query instance that
144
145
* also contains this `QueryFieldFilterConstraint`.
145
146
*/
@@ -205,9 +206,9 @@ export type WhereFilterOp =
205
206
| 'not-in' ;
206
207
207
208
/**
208
- * Creates a {@link QueryFieldFilterConstraint} that enforces that documents must contain the
209
- * specified field and that the value should satisfy the relation constraint
210
- * provided.
209
+ * Creates a {@link QueryFieldFilterConstraint} that enforces that documents
210
+ * must contain the specified field and that the value should satisfy the
211
+ * relation constraint provided.
211
212
*
212
213
* @param fieldPath - The path to compare
213
214
* @param opStr - The operation string (e.g "<", "<=", "==", "<",
@@ -226,11 +227,12 @@ export function where(
226
227
}
227
228
228
229
/**
229
- * A `QueryCompositeFilterConstraint` is used to narrow the set of documents returned by a
230
- * Firestore query by performing the logical OR or AND of multiple {@link QueryFieldFilterConstraint} or {@link QueryCompositeFilterConstraint}.
231
- * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or {@link and} and
232
- * can then be passed to {@link query} to create a new query instance that
233
- * also contains this `QueryCompositeFilterConstraint`.
230
+ * A `QueryCompositeFilterConstraint` is used to narrow the set of documents
231
+ * returned by a Firestore query by performing the logical OR or AND of multiple
232
+ * {@link QueryFieldFilterConstraint} or {@link QueryCompositeFilterConstraint}.
233
+ * `QueryCompositeFilterConstraint`s are created by invoking {@link or} or
234
+ * {@link and} and can then be passed to {@link query} to create a new query
235
+ * instance that also contains this `QueryCompositeFilterConstraint`.
234
236
*/
235
237
export class QueryCompositeFilterConstraint extends QueryFilterConstraint {
236
238
protected constructor (
@@ -264,7 +266,8 @@ export class QueryCompositeFilterConstraint extends QueryFilterConstraint {
264
266
_apply < T > ( query : Query < T > ) : Query < T > {
265
267
const parsedFilter = this . _parse ( query ) ;
266
268
if ( parsedFilter . getFilters ( ) . length === 0 ) {
267
- // Return the existing query if not adding any more filters (e.g. an empty composite filter).
269
+ // Return the existing query if not adding any more filters (e.g. an empty
270
+ // composite filter).
268
271
return query ;
269
272
}
270
273
validateNewFilter ( query . _query , parsedFilter ) ;
@@ -289,8 +292,9 @@ export class QueryCompositeFilterConstraint extends QueryFilterConstraint {
289
292
* Creates a {@link QueryCompositeFilterConstraint} that performs a logical OR
290
293
* of all the provided {@link QueryFilterConstraint}.
291
294
*
292
- * @param queryConstraints - Optional. The {@link queryConstraints} for OR operation. These must be
293
- * created with calls to {@link where}, {@link or}, or {@link and}.
295
+ * @param queryConstraints - Optional. The {@link queryConstraints} for OR
296
+ * operation. These must be created with calls to {@link where}, {@link or}, or
297
+ * {@link and}.
294
298
* @returns The created {@link QueryCompositeFilterConstraint}.
295
299
*/
296
300
export function or (
@@ -311,8 +315,9 @@ export function or(
311
315
* Creates a {@link QueryCompositeFilterConstraint} that performs a logical AND
312
316
* of all the provided {@link QueryFilterConstraint}.
313
317
*
314
- * @param queryConstraints - Optional. The {@link queryConstraints} for AND operation. These must be
315
- * created with calls to {@link where}, {@link or}, or {@link and}.
318
+ * @param queryConstraints - Optional. The {@link queryConstraints} for AND
319
+ * operation. These must be created with calls to {@link where}, {@link or}, or
320
+ * {@link and}.
316
321
* @returns The created {@link QueryCompositeFilterConstraint}.
317
322
*/
318
323
export function and (
@@ -331,10 +336,12 @@ export function and(
331
336
332
337
/**
333
338
* A `QueryOrderByConstraint` is used to sort the set of documents returned by a
334
- * Firestore query.
335
- * `QueryOrderByConstraint`s are created by invoking {@link orderBy} and
336
- * can then be passed to {@link query} to create a new query instance that
337
- * also contains this `QueryOrderByConstraint`.
339
+ * Firestore query. `QueryOrderByConstraint`s are created by invoking
340
+ * {@link orderBy} and can then be passed to {@link query} to create a new query
341
+ * instance that also contains this `QueryOrderByConstraint`.
342
+ *
343
+ * Note: Documents that do not contain the orderBy field will not be present in
344
+ * the query result.
338
345
*/
339
346
export class QueryOrderByConstraint extends QueryConstraint {
340
347
readonly type = 'orderBy' ;
@@ -373,6 +380,9 @@ export type OrderByDirection = 'desc' | 'asc';
373
380
* Creates a {@link QueryOrderByConstraint} that sorts the query result by the
374
381
* specified field, optionally in descending order instead of ascending.
375
382
*
383
+ * Note: Documents that do not contain the specified field will not be present
384
+ * in the query result.
385
+ *
376
386
* @param fieldPath - The field to sort by.
377
387
* @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
378
388
* not specified, order will be ascending.
@@ -388,11 +398,11 @@ export function orderBy(
388
398
}
389
399
390
400
/**
391
- * A `QueryLimitConstraint` is used to limit the number of documents returned by a
392
- * Firestore query.
393
- * `QueryLimitConstraint`s are created by invoking {@link limit} or { @link limitToLast} and
394
- * can then be passed to {@link query} to create a new query instance that
395
- * also contains this `QueryLimitConstraint`.
401
+ * A `QueryLimitConstraint` is used to limit the number of documents returned by
402
+ * a Firestore query.
403
+ * `QueryLimitConstraint`s are created by invoking {@link limit} or
404
+ * { @link limitToLast} and can then be passed to {@link query} to create a new
405
+ * query instance that also contains this `QueryLimitConstraint`.
396
406
*/
397
407
export class QueryLimitConstraint extends QueryConstraint {
398
408
protected constructor (
@@ -421,7 +431,8 @@ export class QueryLimitConstraint extends QueryConstraint {
421
431
}
422
432
423
433
/**
424
- * Creates a {@link QueryLimitConstraint} that only returns the first matching documents.
434
+ * Creates a {@link QueryLimitConstraint} that only returns the first matching
435
+ * documents.
425
436
*
426
437
* @param limit - The maximum number of items to return.
427
438
* @returns The created {@link QueryLimitConstraint}.
@@ -432,7 +443,8 @@ export function limit(limit: number): QueryLimitConstraint {
432
443
}
433
444
434
445
/**
435
- * Creates a {@link QueryLimitConstraint} that only returns the last matching documents.
446
+ * Creates a {@link QueryLimitConstraint} that only returns the last matching
447
+ * documents.
436
448
*
437
449
* You must specify at least one `orderBy` clause for `limitToLast` queries,
438
450
* otherwise an exception will be thrown during execution.
@@ -446,11 +458,11 @@ export function limitToLast(limit: number): QueryLimitConstraint {
446
458
}
447
459
448
460
/**
449
- * A `QueryStartAtConstraint` is used to exclude documents from the start of a result set returned by a
450
- * Firestore query.
451
- * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or { @link (startAfter:1)} and
452
- * can then be passed to {@link query} to create a new query instance that
453
- * also contains this `QueryStartAtConstraint`.
461
+ * A `QueryStartAtConstraint` is used to exclude documents from the start of a
462
+ * result set returned by a Firestore query.
463
+ * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
464
+ * { @link (startAfter:1)} and can then be passed to {@link query} to create a
465
+ * new query instance that also contains this `QueryStartAtConstraint`.
454
466
*/
455
467
export class QueryStartAtConstraint extends QueryConstraint {
456
468
protected constructor (
@@ -485,10 +497,10 @@ export class QueryStartAtConstraint extends QueryConstraint {
485
497
}
486
498
487
499
/**
488
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to start at the
489
- * provided document (inclusive). The starting position is relative to the order
490
- * of the query. The document must contain all of the fields provided in the
491
- * `orderBy` of this query.
500
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
501
+ * start at the provided document (inclusive). The starting position is relative
502
+ * to the order of the query. The document must contain all of the fields
503
+ * provided in the `orderBy` of this query.
492
504
*
493
505
* @param snapshot - The snapshot of the document to start at.
494
506
* @returns A {@link QueryStartAtConstraint} to pass to `query()`.
@@ -497,9 +509,9 @@ export function startAt(
497
509
snapshot : DocumentSnapshot < unknown >
498
510
) : QueryStartAtConstraint ;
499
511
/**
500
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to start at the
501
- * provided fields relative to the order of the query. The order of the field
502
- * values must match the order of the order by clauses of the query.
512
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
513
+ * start at the provided fields relative to the order of the query. The order of
514
+ * the field values must match the order of the order by clauses of the query.
503
515
*
504
516
* @param fieldValues - The field values to start this query at, in order
505
517
* of the query's order by.
@@ -517,10 +529,10 @@ export function startAt(
517
529
}
518
530
519
531
/**
520
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to start after the
521
- * provided document (exclusive). The starting position is relative to the order
522
- * of the query. The document must contain all of the fields provided in the
523
- * orderBy of the query.
532
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
533
+ * start after the provided document (exclusive). The starting position is
534
+ * relative to the order of the query. The document must contain all of the
535
+ * fields provided in the orderBy of the query.
524
536
*
525
537
* @param snapshot - The snapshot of the document to start after.
526
538
* @returns A {@link QueryStartAtConstraint} to pass to `query()`
@@ -529,9 +541,9 @@ export function startAfter(
529
541
snapshot : DocumentSnapshot < unknown >
530
542
) : QueryStartAtConstraint ;
531
543
/**
532
- * Creates a {@link QueryStartAtConstraint} that modifies the result set to start after the
533
- * provided fields relative to the order of the query. The order of the field
534
- * values must match the order of the order by clauses of the query.
544
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
545
+ * start after the provided fields relative to the order of the query. The order
546
+ * of the field values must match the order of the order by clauses of the query.
535
547
*
536
548
* @param fieldValues - The field values to start this query after, in order
537
549
* of the query's order by.
@@ -549,11 +561,11 @@ export function startAfter(
549
561
}
550
562
551
563
/**
552
- * A `QueryEndAtConstraint` is used to exclude documents from the end of a result set returned by a
553
- * Firestore query.
554
- * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or { @link (endBefore:1)} and
555
- * can then be passed to {@link query} to create a new query instance that
556
- * also contains this `QueryEndAtConstraint`.
564
+ * A `QueryEndAtConstraint` is used to exclude documents from the end of a
565
+ * result set returned by a Firestore query.
566
+ * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
567
+ * { @link (endBefore:1)} and can then be passed to {@link query} to create a new
568
+ * query instance that also contains this `QueryEndAtConstraint`.
557
569
*/
558
570
export class QueryEndAtConstraint extends QueryConstraint {
559
571
protected constructor (
@@ -588,10 +600,10 @@ export class QueryEndAtConstraint extends QueryConstraint {
588
600
}
589
601
590
602
/**
591
- * Creates a {@link QueryEndAtConstraint} that modifies the result set to end before the
592
- * provided document (exclusive). The end position is relative to the order of
593
- * the query. The document must contain all of the fields provided in the
594
- * orderBy of the query.
603
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end
604
+ * before the provided document (exclusive). The end position is relative to the
605
+ * order of the query. The document must contain all of the fields provided in
606
+ * the orderBy of the query.
595
607
*
596
608
* @param snapshot - The snapshot of the document to end before.
597
609
* @returns A {@link QueryEndAtConstraint} to pass to `query()`
@@ -600,9 +612,9 @@ export function endBefore(
600
612
snapshot : DocumentSnapshot < unknown >
601
613
) : QueryEndAtConstraint ;
602
614
/**
603
- * Creates a {@link QueryEndAtConstraint} that modifies the result set to end before the
604
- * provided fields relative to the order of the query. The order of the field
605
- * values must match the order of the order by clauses of the query.
615
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end
616
+ * before the provided fields relative to the order of the query. The order of
617
+ * the field values must match the order of the order by clauses of the query.
606
618
*
607
619
* @param fieldValues - The field values to end this query before, in order
608
620
* of the query's order by.
@@ -620,9 +632,9 @@ export function endBefore(
620
632
}
621
633
622
634
/**
623
- * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at the
624
- * provided document (inclusive). The end position is relative to the order of
625
- * the query. The document must contain all of the fields provided in the
635
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
636
+ * the provided document (inclusive). The end position is relative to the order
637
+ * of the query. The document must contain all of the fields provided in the
626
638
* orderBy of the query.
627
639
*
628
640
* @param snapshot - The snapshot of the document to end at.
@@ -632,8 +644,8 @@ export function endAt(
632
644
snapshot : DocumentSnapshot < unknown >
633
645
) : QueryEndAtConstraint ;
634
646
/**
635
- * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at the
636
- * provided fields relative to the order of the query. The order of the field
647
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
648
+ * the provided fields relative to the order of the query. The order of the field
637
649
* values must match the order of the order by clauses of the query.
638
650
*
639
651
* @param fieldValues - The field values to end this query at, in order
0 commit comments