Skip to content

Commit 80c3170

Browse files
committed
ref doc cleanup based on PR feedback
1 parent 606f97a commit 80c3170

3 files changed

Lines changed: 92 additions & 60 deletions

File tree

handwritten/firestore/dev/src/pipelines/expression.ts

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,7 +3108,7 @@ export abstract class Expression
31083108
// * the `lowerBound` (inclusive) and `upperBound` (inclusive).
31093109
// *
31103110
// * @example
3111-
// * ```
3111+
// * ```typescript
31123112
// * // Evaluate if the 'tireWidth' is between 2.2 and 2.4
31133113
// * field('tireWidth').between(constant(2.2), constant(2.4))
31143114
// *
@@ -3118,6 +3118,7 @@ export abstract class Expression
31183118
// *
31193119
// * @param lowerBound - Lower bound (inclusive) of the range.
31203120
// * @param upperBound - Upper bound (inclusive) of the range.
3121+
// * @returns A `BooleanExpression` representing the specified between comparison.
31213122
// */
31223123
// between(lowerBound: Expression, upperBound: Expression): BooleanExpression;
31233124
//
@@ -3126,7 +3127,7 @@ export abstract class Expression
31263127
// * the `lowerBound` (inclusive) and `upperBound` (inclusive).
31273128
// *
31283129
// * @example
3129-
// * ```
3130+
// * ```typescript
31303131
// * // Evaluate if the 'tireWidth' is between 2.2 and 2.4
31313132
// * field('tireWidth').between(2.2, 2.4)
31323133
// *
@@ -3136,6 +3137,7 @@ export abstract class Expression
31363137
// *
31373138
// * @param lowerBound - Lower bound (inclusive) of the range.
31383139
// * @param upperBound - Upper bound (inclusive) of the range.
3140+
// * @returns An `BooleanExpression` representing the specified between comparison.
31393141
// */
31403142
// between(lowerBound: unknown, upperBound: unknown): BooleanExpression;
31413143
//
@@ -3153,7 +3155,8 @@ export abstract class Expression
31533155
// *
31543156
// * @remarks This Expression can only be used within a `Search` stage.
31553157
// *
3156-
// * @param rquery Define the search query using the search DSL.
3158+
// * @param rquery Define the search query using the search domain-specific language (DSL).
3159+
// * @returns An `Expression` representing the snippet function.
31573160
// */
31583161
// snippet(rquery: string): Expression;
31593162
//
@@ -3164,6 +3167,7 @@ export abstract class Expression
31643167
// * @remarks This Expression can only be used within a `Search` stage.
31653168
// *
31663169
// * @param options Define how snippeting behaves.
3170+
// * @returns An `Expression` representing the snippet function.
31673171
// */
31683172
// snippet(options: firestore.Pipelines.SnippetOptions): Expression;
31693173
//
@@ -3433,19 +3437,20 @@ export class Field
34333437
readonly expressionType: firestore.Pipelines.ExpressionType = 'Field';
34343438
selectable = true as const;
34353439

3436-
/**
3437-
* Perform a full-text search on this field.
3438-
*
3439-
* @remarks This Expression can only be used within a `Search` stage.
3440-
*
3441-
* @param rquery Define the search query using the rquery DTS.
3442-
*/
3443-
matches(rquery: string | Expression): BooleanExpression {
3444-
return new FunctionExpression('matches', [
3445-
this,
3446-
valueToDefaultExpr(rquery),
3447-
]).asBoolean();
3448-
}
3440+
// /**
3441+
// * Perform a full-text search on this field.
3442+
// *
3443+
// * @remarks This Expression can only be used within a `Search` stage.
3444+
// *
3445+
// * @param rquery Define the search query using the search domain-specific language (DSL).
3446+
// * @returns A `BooleanExpression` representing the matches function.
3447+
// */
3448+
// matches(rquery: string | Expression): BooleanExpression {
3449+
// return new FunctionExpression('matches', [
3450+
// this,
3451+
// valueToDefaultExpr(rquery),
3452+
// ]).asBoolean();
3453+
// }
34493454

34503455
/**
34513456
* Evaluates to the distance in meters between the location specified
@@ -3454,6 +3459,7 @@ export class Field
34543459
* @remarks This Expression can only be used within a `Search` stage.
34553460
*
34563461
* @param location - Compute distance to this GeoPoint.
3462+
* @returns An `Expression` representing the geoDistance function.
34573463
*/
34583464
geoDistance(location: GeoPoint | Expression): Expression {
34593465
return new FunctionExpression('geo_distance', [
@@ -10421,7 +10427,8 @@ export function isType(
1042110427
// * @remarks This Expression can only be used within a `Search` stage.
1042210428
// *
1042310429
// * @param searchField Search the specified field.
10424-
// * @param rquery Define the search query using the search DSL.
10430+
// * @param rquery Define the search query using the search domain-specific language (DSL).
10431+
// * @returns A `BooleanExpression` representing the matches function.
1042510432
// */
1042610433
// export function matches(
1042710434
// searchField: string | Field,
@@ -10437,7 +10444,8 @@ export function isType(
1043710444
*
1043810445
* @remarks This Expression can only be used within a `Search` stage.
1043910446
*
10440-
* @param rquery Define the search query using the rquery DTS.
10447+
* @param rquery Define the search query using the search domain-specific language (DSL).
10448+
* @returns A `BooleanExpression` representing the documentMatches function.
1044110449
*/
1044210450
export function documentMatches(
1044310451
rquery: string | Expression,
@@ -10456,6 +10464,8 @@ export function documentMatches(
1045610464
* any text predicates, then this score will always be `0`.
1045710465
*
1045810466
* @remarks This Expression can only be used within a `Search` stage.
10467+
*
10468+
* @returns An `Expression` representing the score function.
1045910469
*/
1046010470
export function score(): Expression {
1046110471
return new FunctionExpression('score', []);
@@ -10468,7 +10478,8 @@ export function score(): Expression {
1046810478
// * @remarks This Expression can only be used within a `Search` stage.
1046910479
// *
1047010480
// * @param searchField Search the specified field for matching terms.
10471-
// * @param rquery Define the search query using the search DSL.
10481+
// * @param rquery Define the search query using the search domain-specific language (DSL).
10482+
// * @returns An `Expression` representing the snippet function.
1047210483
// */
1047310484
// export function snippet(
1047410485
// searchField: string | Field,
@@ -10482,7 +10493,8 @@ export function score(): Expression {
1048210493
// * @remarks This Expression can only be used within a `Search` stage.
1048310494
// *
1048410495
// * @param searchField Search the specified field for matching terms.
10485-
// * @param options Define the search query using the search DSL.
10496+
// * @param options Define the search query using the search domain-specific language (DSL).
10497+
// * @returns An `Expression` representing the snippet function.
1048610498
// */
1048710499
// export function snippet(
1048810500
// searchField: string | Field,
@@ -10508,6 +10520,7 @@ export function score(): Expression {
1050810520
* @param fieldName - Specifies the field in the document which contains
1050910521
* the first GeoPoint for distance computation.
1051010522
* @param location - Compute distance to this GeoPoint.
10523+
* @returns An `Expression` representing the geoDistance function.
1051110524
*/
1051210525
export function geoDistance(
1051310526
fieldName: string | Field,
@@ -10521,7 +10534,7 @@ export function geoDistance(
1052110534
// * the evaluated values for `lowerBound` (inclusive) and `upperBound` (inclusive).
1052210535
// *
1052310536
// * @example
10524-
// * ```
10537+
// * ```typescript
1052510538
// * // Evaluate if the 'tireWidth' is between 2.2 and 2.4
1052610539
// * between('tireWidth', constant(2.2), constant(2.4))
1052710540
// *
@@ -10530,8 +10543,9 @@ export function geoDistance(
1053010543
// * ```
1053110544
// *
1053210545
// * @param fieldName - Evaluate if the value stored in this field is between the lower and upper bounds.
10533-
// * @param lowerBound - Lower bound (inclusive) of the range.
10534-
// * @param upperBound - Upper bound (inclusive) of the range.
10546+
// * @param lowerBound - An `Expression` that evaluates to the lower bound (inclusive) of the range.
10547+
// * @param upperBound - An `Expression` that evaluates to the upper bound (inclusive) of the range.
10548+
// * @returns A `BooleanExpression` representing the specified between comparion.
1053510549
// */
1053610550
// export function between(
1053710551
// fieldName: string,
@@ -10544,7 +10558,7 @@ export function geoDistance(
1054410558
// * the values for `lowerBound` (inclusive) and `upperBound` (inclusive).
1054510559
// *
1054610560
// * @example
10547-
// * ```
10561+
// * ```typescript
1054810562
// * // Evaluate if the 'tireWidth' is between 2.2 and 2.4
1054910563
// * between('tireWidth', 2.2, 2.4)
1055010564
// *
@@ -10555,6 +10569,7 @@ export function geoDistance(
1055510569
// * @param fieldName - Evaluate if the value stored in this field is between the lower and upper bounds.
1055610570
// * @param lowerBound - Lower bound (inclusive) of the range.
1055710571
// * @param upperBound - Upper bound (inclusive) of the range.
10572+
// * @returns A `BooleanExpression` representing the specified between comparion.
1055810573
// */
1055910574
// export function between(
1056010575
// fieldName: string,
@@ -10567,7 +10582,7 @@ export function geoDistance(
1056710582
// * the results of `lowerBound` (inclusive) and `upperBound` (inclusive).
1056810583
// *
1056910584
// * @example
10570-
// * ```
10585+
// * ```typescript
1057110586
// * // Evaluate if the 'tireWidth' is between 2.2 and 2.4
1057210587
// * between(field('tireWidth'), constant(2.2), constant(2.4))
1057310588
// *
@@ -10576,8 +10591,9 @@ export function geoDistance(
1057610591
// * ```
1057710592
// *
1057810593
// * @param expression - Evaluate if the result of this expression is between the lower and upper bounds.
10579-
// * @param lowerBound - Lower bound (inclusive) of the range.
10580-
// * @param upperBound - Upper bound (inclusive) of the range.
10594+
// * @param lowerBound - An `Expression` that evaluates to the lower bound (inclusive) of the range.
10595+
// * @param upperBound - An `Expression` that evaluates to the upper bound (inclusive) of the range.
10596+
// * @returns A `BooleanExpression` representing the specified between comparion.
1058110597
// */
1058210598
// export function between(
1058310599
// expression: Expression,
@@ -10590,7 +10606,7 @@ export function geoDistance(
1059010606
// * the `lowerBound` (inclusive) and `upperBound` (inclusive).
1059110607
// *
1059210608
// * @example
10593-
// * ```
10609+
// * ```typescript
1059410610
// * // Evaluate if the 'tireWidth' is between 2.2 and 2.4
1059510611
// * between(field('tireWidth'), 2.2, 2.4)
1059610612
// *
@@ -10601,6 +10617,7 @@ export function geoDistance(
1060110617
// * @param expression - Evaluate if the result of this expression is between the lower and upper bounds.
1060210618
// * @param lowerBound - Lower bound (inclusive) of the range.
1060310619
// * @param upperBound - Upper bound (inclusive) of the range.
10620+
// * @returns A `BooleanExpression` representing the specified between comparion.
1060410621
// */
1060510622
// export function between(
1060610623
// expression: Expression,

handwritten/firestore/dev/src/pipelines/pipelines.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ export class PipelineResult implements firestore.Pipelines.PipelineResult {
20102010
* @returns {T} An object containing all fields in the document.
20112011
*
20122012
* @example
2013-
* ```
2013+
* ```typescript
20142014
* let p = firestore.pipeline().collection('col');
20152015
*
20162016
* p.execute().then(results => {
@@ -2039,7 +2039,7 @@ export class PipelineResult implements firestore.Pipelines.PipelineResult {
20392039
* such field exists.
20402040
*
20412041
* @example
2042-
* ```
2042+
* ```typescript
20432043
* let p = firestore.pipeline().collection('col');
20442044
*
20452045
* p.execute().then(results => {

0 commit comments

Comments
 (0)