Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
0d663ce3
Unverified
Commit
0d663ce3
authored
Mar 24, 2020
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-533: Separate BulkWrite tests by operation
parent
8109cb7e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
257 additions
and
75 deletions
+257
-75
bulkWrite-arrayFilters.json
tests/SpecTests/crud/bulkWrite-arrayFilters.json
+84
-18
bulkWrite-update-hint.json
tests/SpecTests/crud/bulkWrite-update-hint.json
+173
-57
No files found.
tests/SpecTests/crud/bulkWrite-arrayFilters.json
View file @
0d663ce3
...
...
@@ -32,7 +32,7 @@
"database_name"
:
"crud-tests"
,
"tests"
:
[
{
"description"
:
"BulkWrite with arrayFilters"
,
"description"
:
"BulkWrite
updateOne
with arrayFilters"
,
"operations"
:
[
{
"name"
:
"bulkWrite"
,
...
...
@@ -53,7 +53,86 @@
}
]
}
}
],
"options"
:
{
"ordered"
:
true
}
},
"result"
:
{
"deletedCount"
:
0
,
"insertedCount"
:
0
,
"insertedIds"
:
{},
"matchedCount"
:
1
,
"modifiedCount"
:
1
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
}
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"update"
:
"test"
,
"updates"
:
[
{
"q"
:
{},
"u"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
},
"arrayFilters"
:
[
{
"i.b"
:
3
}
]
}
],
"ordered"
:
true
},
"command_name"
:
"update"
,
"database_name"
:
"crud-tests"
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
2
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
}
]
}
}
},
{
"description"
:
"BulkWrite updateMany with arrayFilters"
,
"operations"
:
[
{
"name"
:
"bulkWrite"
,
"arguments"
:
{
"requests"
:
[
{
"name"
:
"updateMany"
,
"arguments"
:
{
...
...
@@ -79,8 +158,8 @@
"deletedCount"
:
0
,
"insertedCount"
:
0
,
"insertedIds"
:
{},
"matchedCount"
:
3
,
"modifiedCount"
:
3
,
"matchedCount"
:
2
,
"modifiedCount"
:
2
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
}
...
...
@@ -92,19 +171,6 @@
"command"
:
{
"update"
:
"test"
,
"updates"
:
[
{
"q"
:
{},
"u"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
},
"arrayFilters"
:
[
{
"i.b"
:
3
}
]
},
{
"q"
:
{},
"u"
:
{
...
...
@@ -134,7 +200,7 @@
"_id"
:
1
,
"y"
:
[
{
"b"
:
2
"b"
:
3
},
{
"b"
:
2
...
...
tests/SpecTests/crud/bulkWrite-update-hint.json
View file @
0d663ce3
...
...
@@ -25,7 +25,7 @@
"collection_name"
:
"test_bulkwrite_update_hint"
,
"tests"
:
[
{
"description"
:
"BulkWrite with update hints"
,
"description"
:
"BulkWrite
updateOne
with update hints"
,
"operations"
:
[
{
"name"
:
"bulkWrite"
,
...
...
@@ -60,32 +60,45 @@
"_id"
:
1
}
}
}
],
"options"
:
{
"ordered"
:
true
}
},
{
"name"
:
"updateMany"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
{
"$lt"
:
3
"result"
:
{
"deletedCount"
:
0
,
"insertedCount"
:
0
,
"insertedIds"
:
{},
"matchedCount"
:
2
,
"modifiedCount"
:
2
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
}
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"update"
:
"test_bulkwrite_update_hint"
,
"updates"
:
[
{
"q"
:
{
"_id"
:
1
},
"u
pdate
"
:
{
"u"
:
{
"$inc"
:
{
"x"
:
1
}
},
"hint"
:
"_id_"
}
},
{
"name"
:
"updateMany"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
{
"$lt"
:
3
}
"q"
:
{
"_id"
:
1
},
"u
pdate
"
:
{
"u"
:
{
"$inc"
:
{
"x"
:
1
}
...
...
@@ -94,27 +107,70 @@
"_id"
:
1
}
}
],
"ordered"
:
true
}
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
13
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
44
}
]
}
}
},
{
"name"
:
"replaceOne"
,
"description"
:
"BulkWrite updateMany with update hints"
,
"operations"
:
[
{
"name"
:
"bulkWrite"
,
"arguments"
:
{
"requests"
:
[
{
"name"
:
"updateMany"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
"_id"
:
{
"$lt"
:
3
}
},
"replacement"
:
{
"x"
:
333
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"hint"
:
"_id_"
}
},
{
"name"
:
"
replaceOne
"
,
"name"
:
"
updateMany
"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
"_id"
:
{
"$lt"
:
3
}
},
"replacement"
:
{
"x"
:
444
"update"
:
{
"$inc"
:
{
"x"
:
1
}
},
"hint"
:
{
"_id"
:
1
...
...
@@ -130,8 +186,8 @@
"deletedCount"
:
0
,
"insertedCount"
:
0
,
"insertedIds"
:
{},
"matchedCount"
:
8
,
"modifiedCount"
:
8
,
"matchedCount"
:
4
,
"modifiedCount"
:
4
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
}
...
...
@@ -145,58 +201,118 @@
"updates"
:
[
{
"q"
:
{
"_id"
:
1
"_id"
:
{
"$lt"
:
3
}
},
"u"
:
{
"$inc"
:
{
"x"
:
1
}
},
"multi"
:
true
,
"hint"
:
"_id_"
},
{
"q"
:
{
"_id"
:
1
"_id"
:
{
"$lt"
:
3
}
},
"u"
:
{
"$inc"
:
{
"x"
:
1
}
},
"multi"
:
true
,
"hint"
:
{
"_id"
:
1
}
}
],
"ordered"
:
true
}
}
}
],
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
13
},
{
"q"
:
{
"_id"
:
{
"$lt"
:
3
}
"_id"
:
2
,
"x"
:
24
},
"u"
:
{
"$inc"
:
{
"x"
:
1
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
44
}
]
}
}
},
"multi"
:
true
,
{
"description"
:
"BulkWrite replaceOne with update hints"
,
"operations"
:
[
{
"name"
:
"bulkWrite"
,
"arguments"
:
{
"requests"
:
[
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
},
"replacement"
:
{
"x"
:
333
},
"hint"
:
"_id_"
}
},
{
"q"
:
{
"_id
"
:
{
"$lt"
:
3
}
"name"
:
"replaceOne"
,
"arguments
"
:
{
"filter"
:
{
"_id"
:
4
},
"u"
:
{
"$inc"
:
{
"x"
:
1
}
"replacement"
:
{
"x"
:
444
},
"multi"
:
true
,
"hint"
:
{
"_id"
:
1
}
}
}
],
"options"
:
{
"ordered"
:
true
}
},
"result"
:
{
"deletedCount"
:
0
,
"insertedCount"
:
0
,
"insertedIds"
:
{},
"matchedCount"
:
2
,
"modifiedCount"
:
2
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
}
}
],
"expectations"
:
[
{
"command_started_event"
:
{
"command"
:
{
"update"
:
"test_bulkwrite_update_hint"
,
"updates"
:
[
{
"q"
:
{
"_id"
:
3
...
...
@@ -228,11 +344,11 @@
"data"
:
[
{
"_id"
:
1
,
"x"
:
1
5
"x"
:
1
1
},
{
"_id"
:
2
,
"x"
:
2
4
"x"
:
2
2
},
{
"_id"
:
3
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment