Commit fc8988a9 authored by Jeremy Mikola's avatar Jeremy Mikola

Merge pull request #568

parents bd148eab 38b0f693
...@@ -240,6 +240,10 @@ class CrudSpecFunctionalTest extends FunctionalTestCase ...@@ -240,6 +240,10 @@ class CrudSpecFunctionalTest extends FunctionalTestCase
$this->assertSame($expectedResult['deletedCount'], $actualResult->getDeletedCount()); $this->assertSame($expectedResult['deletedCount'], $actualResult->getDeletedCount());
} }
if (isset($expectedResult['insertedCount'])) {
$this->assertSame($expectedResult['insertedCount'], $actualResult->getInsertedCount());
}
if (isset($expectedResult['insertedIds'])) { if (isset($expectedResult['insertedIds'])) {
$this->assertSameDocument( $this->assertSameDocument(
['insertedIds' => $expectedResult['insertedIds']], ['insertedIds' => $expectedResult['insertedIds']],
......
...@@ -28,48 +28,57 @@ ...@@ -28,48 +28,57 @@
{ {
"description": "BulkWrite with arrayFilters", "description": "BulkWrite with arrayFilters",
"operation": { "operation": {
"name": "bulkWrite",
"arguments": { "arguments": {
"options": {
"ordered": true
},
"requests": [ "requests": [
{ {
"name": "updateOne",
"arguments": { "arguments": {
"arrayFilters": [
{
"i.b": 3
}
],
"filter": {}, "filter": {},
"update": { "update": {
"$set": { "$set": {
"y.$[i].b": 2 "y.$[i].b": 2
} }
} },
},
"name": "updateOne"
},
{
"arguments": {
"arrayFilters": [ "arrayFilters": [
{ {
"i.b": 1 "i.b": 3
} }
], ]
}
},
{
"name": "updateMany",
"arguments": {
"filter": {}, "filter": {},
"update": { "update": {
"$set": { "$set": {
"y.$[i].b": 2 "y.$[i].b": 2
} }
} },
}, "arrayFilters": [
"name": "updateMany" {
"i.b": 1
}
]
}
} }
] ],
}, "options": {
"name": "bulkWrite" "ordered": true
}
}
}, },
"outcome": { "outcome": {
"result": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 3,
"modifiedCount": 3,
"upsertedCount": 0,
"upsertedIds": {}
},
"collection": { "collection": {
"data": [ "data": [
{ {
...@@ -95,16 +104,8 @@ ...@@ -95,16 +104,8 @@
] ]
} }
] ]
},
"result": {
"deletedCount": 0,
"insertedIds": {},
"matchedCount": 3,
"modifiedCount": 3,
"upsertedCount": 0,
"upsertedIds": {}
} }
} }
} }
] ]
} }
\ No newline at end of file
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
}, },
"outcome": { "outcome": {
"result": { "result": {
"insertedIds": [ "insertedIds": {
2, "0": 2,
3 "1": 3
] }
}, },
"collection": { "collection": {
"data": [ "data": [
......
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 2, "matchedCount": 2,
"modifiedCount": 0 "modifiedCount": 0,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
...@@ -148,7 +149,8 @@ ...@@ -148,7 +149,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 2, "matchedCount": 2,
"modifiedCount": 2 "modifiedCount": 2,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
......
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
"modifiedCount": 0 "modifiedCount": 0,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
...@@ -129,7 +130,8 @@ ...@@ -129,7 +130,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
"modifiedCount": 1 "modifiedCount": 1,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
...@@ -196,7 +198,8 @@ ...@@ -196,7 +198,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
"modifiedCount": 1 "modifiedCount": 1,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
...@@ -268,7 +271,8 @@ ...@@ -268,7 +271,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
"modifiedCount": 0 "modifiedCount": 0,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
...@@ -340,7 +344,8 @@ ...@@ -340,7 +344,8 @@
"outcome": { "outcome": {
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
"modifiedCount": 1 "modifiedCount": 1,
"upsertedCount": 0
}, },
"collection": { "collection": {
"data": [ "data": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment