@@ -111,10 +111,14 @@ field("optional_field").ifAbsent(field('default_field'))
111111| [log10 ()](./firestore_lite_pipelines .expression .md #expressionlog10 ) | | <b ><i >(Public Preview )</i ></b > Creates an expression that computes the base -10 logarithm of a numeric value . |
112112| [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 . |
113113| [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 . |
114+ | [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 > . |
114115| [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 . |
116+ | [mapKeys ()](./ firestore_lite_pipelines. expression. md#expressionmapkeys) | | <b><i>(Public Preview)</ i > </b > Creates an expression that returns the keys of a map .< ! -- -- > Note : While the backend generally preserves insertion order , relying on the order of the output array is not guaranteed and should be avoided . |
115117| [mapMerge (secondMap , otherMaps )](./ firestore_lite_pipelines. expression. md#expressionmapmerge) | | <b><i>(Public Preview)</ i > </b > Creates an expression that merges multiple map values . |
116118| [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 . |
117119| [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 . |
120+ | [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 .< ! -- -- > Note that < code > mapSet < / code > only performs shallow updates to the map . Setting a value to < code > null < / code > will retain the key with a < code > null < / code > value . To remove a key entirely , use . |
121+ | [mapValues ()](./ firestore_lite_pipelines. expression. md#expressionmapvalues) | | <b><i>(Public Preview)</ i > </b > Creates an expression that returns the values of a map .< ! -- -- > Note : While the backend generally preserves insertion order , relying on the order of the output array is not guaranteed and should be avoided . |
118122| [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 . |
119123| [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 . |
120124| [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 . |
@@ -2305,6 +2309,33 @@ field("timestamp").logicalMinimum(Function.currentTimestamp());
23052309
23062310` ` `
23072311
2312+ ## Expression.mapEntries()
2313+
2314+ > 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.
2315+ >
2316+
2317+ 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" }, ... ]` <!-- -->.
2318+
2319+ <b>Signature:</b>
2320+
2321+ ` ` ` typescript
2322+ mapEntries (): FunctionExpression ;
2323+ ` ` `
2324+ <b>Returns:</b>
2325+
2326+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2327+
2328+ A new ` Expression ` representing the entries of the map.
2329+
2330+ ### Example
2331+
2332+
2333+ ` ` ` typescript
2334+ // Get the entries of the 'address' map
2335+ field (" address" ).mapEntries ();
2336+
2337+ ` ` `
2338+
23082339## Expression.mapGet()
23092340
23102341> 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.
@@ -2339,6 +2370,35 @@ field("address").mapGet("city");
23392370
23402371` ` `
23412372
2373+ ## Expression.mapKeys()
2374+
2375+ > 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.
2376+ >
2377+
2378+ Creates an expression that returns the keys of a map.
2379+
2380+ Note: While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
2381+
2382+ <b>Signature:</b>
2383+
2384+ ` ` ` typescript
2385+ mapKeys (): FunctionExpression ;
2386+ ` ` `
2387+ <b>Returns:</b>
2388+
2389+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2390+
2391+ A new ` Expression ` representing the keys of the map.
2392+
2393+ ### Example
2394+
2395+
2396+ ` ` ` typescript
2397+ // Get the keys of the 'address' map
2398+ field (" address" ).mapKeys ();
2399+
2400+ ` ` `
2401+
23422402## Expression.mapMerge()
23432403
23442404> 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.
@@ -2444,6 +2504,73 @@ map({foo: 'bar', baz: true}).mapRemove(constant('baz'));
24442504
24452505` ` `
24462506
2507+ ## Expression.mapSet()
2508+
2509+ > 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.
2510+ >
2511+
2512+ Creates an expression that returns a new map with the specified entries added or updated.
2513+
2514+ 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 .
2515+
2516+ <b>Signature:</b>
2517+
2518+ ` ` ` typescript
2519+ mapSet (key : string | Expression , value : unknown , ... moreKeyValues : unknown []): FunctionExpression ;
2520+ ` ` `
2521+
2522+ #### Parameters
2523+
2524+ | Parameter | Type | Description |
2525+ | --- | --- | --- |
2526+ | key | string \| [Expression](./firestore_lite_pipelines.expression.md#expression_class) | The key to set. |
2527+ | value | unknown | The value to set. |
2528+ | moreKeyValues | unknown\[\] | Additional key-value pairs to set. |
2529+
2530+ <b>Returns:</b>
2531+
2532+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2533+
2534+ A new ` Expression ` representing the map with the entries set.
2535+
2536+ ### Example
2537+
2538+
2539+ ` ` ` typescript
2540+ // Set the 'city' to "San Francisco" in the 'address' map
2541+ field (" address" ).mapSet (" city" , " San Francisco" );
2542+
2543+ ` ` `
2544+
2545+ ## Expression.mapValues()
2546+
2547+ > 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.
2548+ >
2549+
2550+ Creates an expression that returns the values of a map.
2551+
2552+ Note: While the backend generally preserves insertion order, relying on the order of the output array is not guaranteed and should be avoided.
2553+
2554+ <b>Signature:</b>
2555+
2556+ ` ` ` typescript
2557+ mapValues (): FunctionExpression ;
2558+ ` ` `
2559+ <b>Returns:</b>
2560+
2561+ [FunctionExpression](./firestore_lite_pipelines.functionexpression.md#functionexpression_class)
2562+
2563+ A new ` Expression ` representing the values of the map.
2564+
2565+ ### Example
2566+
2567+
2568+ ` ` ` typescript
2569+ // Get the values of the 'address' map
2570+ field (" address" ).mapValues ();
2571+
2572+ ` ` `
2573+
24472574## Expression.maximum()
24482575
24492576> 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