@@ -117,10 +117,14 @@ field("optional_field").ifAbsent(field('default_field'))
117117| [logicalMaximum (second , others )](./firestore_lite_pipelines .expression .md #expressionlogicalmaximum ) | | <b ><i >(Public Preview )</i ></b > Creates an expression that returns the larger value between this expression and another expression , based on Firestore 's value type ordering . |
118118| [logicalMinimum (second , others )](./firestore_lite_pipelines .expression .md #expressionlogicalminimum ) | | <b ><i >(Public Preview )</i ></b > Creates an expression that returns the smaller value between this expression and another expression , based on Firestore 's value type ordering . |
119119| [ltrim (valueToTrim )](./firestore_lite_pipelines .expression .md #expressionltrim ) | | <b ><i >(Public Preview )</i ></b > Trims whitespace or a specified set of characters /bytes from the beginning of a string or byte array . |
120+ | [mapEntries ()](./firestore_lite_pipelines .expression .md #expressionmapentries ) | | <b ><i >(Public Preview )</i ></b > Creates an expression that returns the entries of a map as an array of maps , where each map contains a <code >" ;k " ;</code > property for the key and a <code >" ;v " ;</code > property for the value . For example : <code >[{ k: & quot ;key1 & quot;, v: & quot ;value1 & quot; }, ... ]< / code > . |
120121| [mapGet (subfield )](./ firestore_lite_pipelines. expression. md#expressionmapget) | | <b><i>(Public Preview)</ i > </b > Accesses a value from a map (object ) field using the provided key . |
122+ | [mapKeys ()](./ firestore_lite_pipelines. expression. md#expressionmapkeys) | | <b><i>(Public Preview)</ i > </b > Creates an expression that returns the keys of a map . |
121123| [mapMerge (secondMap , otherMaps )](./ firestore_lite_pipelines. expression. md#expressionmapmerge) | | <b><i>(Public Preview)</ i > </b > Creates an expression that merges multiple map values . |
122124| [mapRemove (key )](./ firestore_lite_pipelines. expression. md#expressionmapremove) | | <b><i>(Public Preview)</ i > </b > Creates an expression that removes a key from the map produced by evaluating this expression . |
123125| [mapRemove (keyExpr )](./ firestore_lite_pipelines. expression. md#expressionmapremove) | | <b><i>(Public Preview)</ i > </b > Creates an expression that removes a key from the map produced by evaluating this expression . |
126+ | [mapSet (key , value , moreKeyValues )](./ firestore_lite_pipelines. expression. md#expressionmapset) | | <b><i>(Public Preview)</ i > </b > Creates an expression that returns a new map with the specified entries added or updated . |
127+ | [mapValues ()](./ firestore_lite_pipelines. expression. md#expressionmapvalues) | | <b><i>(Public Preview)</ i > </b > Creates an expression that returns the values of a map . |
124128| [maximum ()](./ firestore_lite_pipelines. expression. md#expressionmaximum) | | <b><i>(Public Preview)</ i > </b > Creates an aggregation that finds the maximum value of a field across multiple stage inputs . |
125129| [minimum ()](./ firestore_lite_pipelines. expression. md#expressionminimum) | | <b><i>(Public Preview)</ i > </b > Creates an aggregation that finds the minimum value of a field across multiple stage inputs . |
126130| [mod (expression )](./ firestore_lite_pipelines. expression. md#expressionmod) | | <b><i>(Public Preview)</ i > </b > Creates an expression that calculates the modulo (remainder ) of dividing this expression by another expression . |
@@ -2504,6 +2508,33 @@ field("userInput").ltrim('"');
25042508
25052509` ` `
25062510
2511+ ## Expression.mapEntries()
2512+
2513+ > 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.
2514+ >
2515+
2516+ Creates an expression that returns the entries of a map as an array of maps, where each map contains a ` " k" ` property for the key and a ` " v" ` property for the value. For example: ` [{ k: " key1" , v: " value1" }, ... ]` <!-- -->.
2517+
2518+ <b>Signature:</b>
2519+
2520+ ` ` ` typescript
2521+ mapEntries (): FunctionExpression ;
2522+ ` ` `
2523+ <b>Returns:</b>
2524+
2525+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2526+
2527+ A new ` Expression ` representing the entries of the map.
2528+
2529+ ### Example
2530+
2531+
2532+ ` ` ` typescript
2533+ // Get the entries of the 'address' map
2534+ field (" address" ).mapEntries ();
2535+
2536+ ` ` `
2537+
25072538## Expression.mapGet()
25082539
25092540> 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.
@@ -2538,6 +2569,35 @@ field("address").mapGet("city");
25382569
25392570` ` `
25402571
2572+ ## Expression.mapKeys()
2573+
2574+ > 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.
2575+ >
2576+
2577+ Creates an expression that returns the keys of a map.
2578+
2579+ While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
2580+
2581+ <b>Signature:</b>
2582+
2583+ ` ` ` typescript
2584+ mapKeys (): FunctionExpression ;
2585+ ` ` `
2586+ <b>Returns:</b>
2587+
2588+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2589+
2590+ A new ` Expression ` representing the keys of the map.
2591+
2592+ ### Example
2593+
2594+
2595+ ` ` ` typescript
2596+ // Get the keys of the 'address' map
2597+ field (" address" ).mapKeys ();
2598+
2599+ ` ` `
2600+
25412601## Expression.mapMerge()
25422602
25432603> 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.
@@ -2643,6 +2703,73 @@ map({foo: 'bar', baz: true}).mapRemove(constant('baz'));
26432703
26442704` ` `
26452705
2706+ ## Expression.mapSet()
2707+
2708+ > 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.
2709+ >
2710+
2711+ Creates an expression that returns a new map with the specified entries added or updated.
2712+
2713+ Note that ` mapSet ` only performs shallow updates to the map. Setting a value to ` null ` will retain the key with a ` null ` value. To remove a key entirely, use ` mapRemove ` <!-- -->.
2714+
2715+ <b>Signature:</b>
2716+
2717+ ` ` ` typescript
2718+ mapSet (key : string | Expression , value : unknown , ... moreKeyValues : unknown []): FunctionExpression ;
2719+ ` ` `
2720+
2721+ #### Parameters
2722+
2723+ | Parameter | Type | Description |
2724+ | --- | --- | --- |
2725+ | key | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The key to set. Must be a string or a constant string expression. |
2726+ | value | unknown | The value to set. |
2727+ | moreKeyValues | unknown\[\] | Additional key-value pairs to set. |
2728+
2729+ <b>Returns:</b>
2730+
2731+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2732+
2733+ A new ` Expression ` representing the map with the entries set.
2734+
2735+ ### Example
2736+
2737+
2738+ ` ` ` typescript
2739+ // Set the 'city' to "San Francisco" in the 'address' map
2740+ field (" address" ).mapSet (" city" , " San Francisco" );
2741+
2742+ ` ` `
2743+
2744+ ## Expression.mapValues()
2745+
2746+ > 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.
2747+ >
2748+
2749+ Creates an expression that returns the values of a map.
2750+
2751+ While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
2752+
2753+ <b>Signature:</b>
2754+
2755+ ` ` ` typescript
2756+ mapValues (): FunctionExpression ;
2757+ ` ` `
2758+ <b>Returns:</b>
2759+
2760+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2761+
2762+ A new ` Expression ` representing the values of the map.
2763+
2764+ ### Example
2765+
2766+
2767+ ` ` ` typescript
2768+ // Get the values of the 'address' map
2769+ field (" address" ).mapValues ();
2770+
2771+ ` ` `
2772+
26462773## Expression.maximum()
26472774
26482775> 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.
0 commit comments