File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
articles/cosmos-db/mongodb/vcore/operators/object-expression Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11---
22 title : $mergeObjects
3- titleSuffix : Overview of the $mergeObjects expression in Azure Cosmos DB for MongoDB (vCore)
3+ titleSuffix : Overview of the $mergeObjects operator in Azure Cosmos DB for MongoDB (vCore)
44 description : The $mergeObjects operator merges multiple documents into a single document
55 author : abinav2307
66 ms.author : abramees
77 ms.service : azure-cosmos-db
88 ms.subservice : mongodb-vcore
99 ms.topic : language-reference
10- ms.date : 08/03 /2025
10+ ms.date : 09/04 /2025
1111---
1212
1313# $mergeObjects
@@ -30,7 +30,7 @@ The `$mergeObjects` operator combines multiple documents into a single document.
3030
3131## Examples
3232
33- Let's understand the usage with sample json from ` stores ` dataset .
33+ Consider this sample document from the stores collection .
3434
3535``` json
3636{
@@ -144,7 +144,7 @@ Let's understand the usage with sample json from `stores` dataset.
144144
145145### Example 1 - Merging documents as an accumulator to group documents by the sales subdocument
146146
147- The query is an aggregation pipeline that uses $mergeObjects to merge all sales subdocuments per city for a specific company.
147+ The query merges all sales subdocuments per city for a specific company.
148148
149149``` javascript
150150db .stores .aggregate ([
@@ -167,7 +167,7 @@ db.stores.aggregate([
167167])
168168```
169169
170- The query groups store documents by city for the company "Fourth Coffee" and merges their sales fields into a single object per city.
170+ The first two results returned by this query are:
171171
172172``` json
173173[
You can’t perform that action at this time.
0 commit comments