Skip to content
6 changes: 6 additions & 0 deletions .changeset/eighty-ghosts-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'firebase': minor
'@firebase/firestore': minor
---

Support added for the following string Pipeline expressions: `stringRepeat`, `stringReplaceOne`, `stringReplaceAll`, `stringIndexOf`, `ltrim`, `rtrim`.
48 changes: 48 additions & 0 deletions common/api-review/firestore-lite-pipelines.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ export abstract class Expression {
/* Excluded from this release type: _readUserData */
logicalMinimum(second: Expression | unknown, ...others: Array<Expression | unknown>): FunctionExpression;
/* Excluded from this release type: _readUserData */
ltrim(valueToTrim?: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
mapGet(subfield: string): FunctionExpression;
/* Excluded from this release type: _readUserData */
mapMerge(secondMap: Record<string, unknown> | Expression, ...otherMaps: Array<Record<string, unknown> | Expression>): FunctionExpression;
Expand Down Expand Up @@ -564,6 +566,8 @@ export abstract class Expression {
/* Excluded from this release type: _readUserData */
round(decimalPlaces: Expression): FunctionExpression;
/* Excluded from this release type: _readUserData */
rtrim(valueToTrim?: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
split(delimiter: string): FunctionExpression;
/* Excluded from this release type: _readUserData */
split(delimiter: Expression): FunctionExpression;
Expand All @@ -580,6 +584,14 @@ export abstract class Expression {
/* Excluded from this release type: _readUserData */
stringContains(expr: Expression): BooleanExpression;
/* Excluded from this release type: _readUserData */
stringIndexOf(search: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringRepeat(repetitions: number | Expression): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringReplaceAll(find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringReplaceOne(find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringReverse(): FunctionExpression;
/* Excluded from this release type: _readUserData */
substring(position: number, length?: number): FunctionExpression;
Expand Down Expand Up @@ -824,6 +836,12 @@ export function logicalMinimum(first: Expression, second: Expression | unknown,
// @beta
export function logicalMinimum(fieldName: string, second: Expression | unknown, ...others: Array<Expression | unknown>): FunctionExpression;

// @beta
export function ltrim(fieldName: string, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export function ltrim(expression: Expression, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export function map(elements: Record<string, unknown>): FunctionExpression;

Expand Down Expand Up @@ -1093,6 +1111,12 @@ export function round(fieldName: string, decimalPlaces: number | Expression): Fu
// @beta
export function round(expression: Expression, decimalPlaces: number | Expression): FunctionExpression;

// @beta
export function rtrim(fieldName: string, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export function rtrim(expression: Expression, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export type SampleStageOptions = StageOptions & OneOf<{
percentage: number;
Expand Down Expand Up @@ -1170,6 +1194,30 @@ export function stringContains(stringExpression: Expression, substring: string):
// @beta
export function stringContains(stringExpression: Expression, substring: Expression): BooleanExpression;

// @beta
export function stringIndexOf(fieldName: string, search: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringIndexOf(expression: Expression, search: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringRepeat(fieldName: string, repetitions: number | Expression): FunctionExpression;

// @beta
export function stringRepeat(expression: Expression, repetitions: number | Expression): FunctionExpression;

// @beta
export function stringReplaceAll(fieldName: string, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReplaceAll(expression: Expression, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReplaceOne(fieldName: string, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReplaceOne(expression: Expression, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReverse(stringExpression: Expression): FunctionExpression;

Expand Down
48 changes: 48 additions & 0 deletions common/api-review/firestore-pipelines.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ export abstract class Expression {
/* Excluded from this release type: _readUserData */
logicalMinimum(second: Expression | unknown, ...others: Array<Expression | unknown>): FunctionExpression;
/* Excluded from this release type: _readUserData */
ltrim(valueToTrim?: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
mapGet(subfield: string): FunctionExpression;
/* Excluded from this release type: _readUserData */
mapMerge(secondMap: Record<string, unknown> | Expression, ...otherMaps: Array<Record<string, unknown> | Expression>): FunctionExpression;
Expand Down Expand Up @@ -567,6 +569,8 @@ export abstract class Expression {
/* Excluded from this release type: _readUserData */
round(decimalPlaces: Expression): FunctionExpression;
/* Excluded from this release type: _readUserData */
rtrim(valueToTrim?: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
split(delimiter: string): FunctionExpression;
/* Excluded from this release type: _readUserData */
split(delimiter: Expression): FunctionExpression;
Expand All @@ -583,6 +587,14 @@ export abstract class Expression {
/* Excluded from this release type: _readUserData */
stringContains(expr: Expression): BooleanExpression;
/* Excluded from this release type: _readUserData */
stringIndexOf(search: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringRepeat(repetitions: number | Expression): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringReplaceAll(find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringReplaceOne(find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;
/* Excluded from this release type: _readUserData */
stringReverse(): FunctionExpression;
/* Excluded from this release type: _readUserData */
substring(position: number, length?: number): FunctionExpression;
Expand Down Expand Up @@ -827,6 +839,12 @@ export function logicalMinimum(first: Expression, second: Expression | unknown,
// @beta
export function logicalMinimum(fieldName: string, second: Expression | unknown, ...others: Array<Expression | unknown>): FunctionExpression;

// @beta
export function ltrim(fieldName: string, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export function ltrim(expression: Expression, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export function map(elements: Record<string, unknown>): FunctionExpression;

Expand Down Expand Up @@ -1130,6 +1148,12 @@ export function round(fieldName: string, decimalPlaces: number | Expression): Fu
// @beta
export function round(expression: Expression, decimalPlaces: number | Expression): FunctionExpression;

// @beta
export function rtrim(fieldName: string, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export function rtrim(expression: Expression, valueToTrim?: string | Expression | Bytes): FunctionExpression;

// @beta
export type SampleStageOptions = StageOptions & OneOf<{
percentage: number;
Expand Down Expand Up @@ -1207,6 +1231,30 @@ export function stringContains(stringExpression: Expression, substring: string):
// @beta
export function stringContains(stringExpression: Expression, substring: Expression): BooleanExpression;

// @beta
export function stringIndexOf(fieldName: string, search: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringIndexOf(expression: Expression, search: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringRepeat(fieldName: string, repetitions: number | Expression): FunctionExpression;

// @beta
export function stringRepeat(expression: Expression, repetitions: number | Expression): FunctionExpression;

// @beta
export function stringReplaceAll(fieldName: string, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReplaceAll(expression: Expression, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReplaceOne(fieldName: string, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReplaceOne(expression: Expression, find: string | Expression | Bytes, replacement: string | Expression | Bytes): FunctionExpression;

// @beta
export function stringReverse(stringExpression: Expression): FunctionExpression;

Expand Down
Loading
Loading