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
11a843eb
Commit
11a843eb
authored
Nov 28, 2017
by
Katherine Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-295 Sync arrayFilters crud tests
Also drop support for Mongo 2.4 (PHPLIB-282)
parent
762b6e90
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
964 additions
and
472 deletions
+964
-472
aggregate-collation.json
tests/Collection/spec-tests/read/aggregate-collation.json
+1
-1
aggregate-out.json
tests/Collection/spec-tests/read/aggregate-out.json
+52
-1
aggregate.json
tests/Collection/spec-tests/read/aggregate.json
+1
-1
count-collation.json
tests/Collection/spec-tests/read/count-collation.json
+1
-1
count.json
tests/Collection/spec-tests/read/count.json
+1
-1
distinct-collation.json
tests/Collection/spec-tests/read/distinct-collation.json
+1
-1
distinct.json
tests/Collection/spec-tests/read/distinct.json
+1
-1
find-collation.json
tests/Collection/spec-tests/read/find-collation.json
+1
-1
find.json
tests/Collection/spec-tests/read/find.json
+1
-1
bulkWrite-arrayFilters.json
...s/Collection/spec-tests/write/bulkWrite-arrayFilters.json
+110
-0
deleteMany-collation.json
tests/Collection/spec-tests/write/deleteMany-collation.json
+1
-1
deleteMany.json
tests/Collection/spec-tests/write/deleteMany.json
+1
-1
deleteOne-collation.json
tests/Collection/spec-tests/write/deleteOne-collation.json
+1
-1
deleteOne.json
tests/Collection/spec-tests/write/deleteOne.json
+1
-1
findOneAndDelete-collation.json
...llection/spec-tests/write/findOneAndDelete-collation.json
+1
-1
findOneAndDelete.json
tests/Collection/spec-tests/write/findOneAndDelete.json
+1
-1
findOneAndReplace-collation.json
...lection/spec-tests/write/findOneAndReplace-collation.json
+1
-1
findOneAndReplace-upsert.json
...Collection/spec-tests/write/findOneAndReplace-upsert.json
+1
-1
findOneAndReplace-upsert_pre_2.6.json
...on/spec-tests/write/findOneAndReplace-upsert_pre_2.6.json
+0
-161
findOneAndReplace.json
tests/Collection/spec-tests/write/findOneAndReplace.json
+1
-1
findOneAndUpdate-arrayFilters.json
...ction/spec-tests/write/findOneAndUpdate-arrayFilters.json
+203
-0
findOneAndUpdate-collation.json
...llection/spec-tests/write/findOneAndUpdate-collation.json
+1
-1
findOneAndUpdate.json
tests/Collection/spec-tests/write/findOneAndUpdate.json
+1
-1
insertMany.json
tests/Collection/spec-tests/write/insertMany.json
+1
-1
insertOne.json
tests/Collection/spec-tests/write/insertOne.json
+1
-1
replaceOne-collation.json
tests/Collection/spec-tests/write/replaceOne-collation.json
+1
-1
replaceOne-pre_2.6.json
tests/Collection/spec-tests/write/replaceOne-pre_2.6.json
+0
-179
replaceOne-upsert.json
tests/Collection/spec-tests/write/replaceOne-upsert.json
+0
-104
replaceOne.json
tests/Collection/spec-tests/write/replaceOne.json
+1
-1
updateMany-arrayFilters.json
.../Collection/spec-tests/write/updateMany-arrayFilters.json
+182
-0
updateMany-collation.json
tests/Collection/spec-tests/write/updateMany-collation.json
+1
-1
updateMany.json
tests/Collection/spec-tests/write/updateMany.json
+1
-1
updateOne-arrayFilters.json
...s/Collection/spec-tests/write/updateOne-arrayFilters.json
+390
-0
updateOne-collation.json
tests/Collection/spec-tests/write/updateOne-collation.json
+1
-1
updateOne.json
tests/Collection/spec-tests/write/updateOne.json
+1
-1
No files found.
tests/Collection/spec-tests/read/aggregate-collation.json
View file @
11a843eb
...
@@ -35,4 +35,4 @@
...
@@ -35,4 +35,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/aggregate-out.json
View file @
11a843eb
...
@@ -65,6 +65,57 @@
...
@@ -65,6 +65,57 @@
]
]
}
}
}
}
},
{
"description"
:
"Aggregate with $out and batch size of 0"
,
"operation"
:
{
"name"
:
"aggregate"
,
"arguments"
:
{
"pipeline"
:
[
{
"$sort"
:
{
"x"
:
1
}
},
{
"$match"
:
{
"_id"
:
{
"$gt"
:
1
}
}
},
{
"$out"
:
"other_test_collection"
}
],
"batchSize"
:
0
}
},
"outcome"
:
{
"result"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"collection"
:
{
"name"
:
"other_test_collection"
,
"data"
:
[
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/aggregate.json
View file @
11a843eb
...
@@ -50,4 +50,4 @@
...
@@ -50,4 +50,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/count-collation.json
View file @
11a843eb
...
@@ -26,4 +26,4 @@
...
@@ -26,4 +26,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/count.json
View file @
11a843eb
...
@@ -57,4 +57,4 @@
...
@@ -57,4 +57,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/distinct-collation.json
View file @
11a843eb
...
@@ -30,4 +30,4 @@
...
@@ -30,4 +30,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/distinct.json
View file @
11a843eb
...
@@ -52,4 +52,4 @@
...
@@ -52,4 +52,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/find-collation.json
View file @
11a843eb
...
@@ -31,4 +31,4 @@
...
@@ -31,4 +31,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/read/find.json
View file @
11a843eb
...
@@ -102,4 +102,4 @@
...
@@ -102,4 +102,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/bulkWrite-arrayFilters.json
0 → 100644
View file @
11a843eb
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
}
],
"minServerVersion"
:
"3.5.6"
,
"tests"
:
[
{
"description"
:
"BulkWrite with arrayFilters"
,
"operation"
:
{
"arguments"
:
{
"options"
:
{
"ordered"
:
true
},
"requests"
:
[
{
"arguments"
:
{
"arrayFilters"
:
[
{
"i.b"
:
3
}
],
"filter"
:
{},
"update"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
}
},
"name"
:
"updateOne"
},
{
"arguments"
:
{
"arrayFilters"
:
[
{
"i.b"
:
1
}
],
"filter"
:
{},
"update"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
}
},
"name"
:
"updateMany"
}
]
},
"name"
:
"bulkWrite"
},
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
2
},
{
"b"
:
2
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
2
}
]
}
]
},
"result"
:
{
"deletedCount"
:
0
,
"insertedIds"
:
{},
"matchedCount"
:
3
,
"modifiedCount"
:
3
,
"upsertedCount"
:
0
,
"upsertedIds"
:
{}
}
}
}
]
}
\ No newline at end of file
tests/Collection/spec-tests/write/deleteMany-collation.json
View file @
11a843eb
...
@@ -44,4 +44,4 @@
...
@@ -44,4 +44,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/deleteMany.json
View file @
11a843eb
...
@@ -73,4 +73,4 @@
...
@@ -73,4 +73,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/deleteOne-collation.json
View file @
11a843eb
...
@@ -48,4 +48,4 @@
...
@@ -48,4 +48,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/deleteOne.json
View file @
11a843eb
...
@@ -93,4 +93,4 @@
...
@@ -93,4 +93,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndDelete-collation.json
View file @
11a843eb
...
@@ -56,4 +56,4 @@
...
@@ -56,4 +56,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndDelete.json
View file @
11a843eb
...
@@ -124,4 +124,4 @@
...
@@ -124,4 +124,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndReplace-collation.json
View file @
11a843eb
...
@@ -55,4 +55,4 @@
...
@@ -55,4 +55,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndReplace-upsert.json
View file @
11a843eb
...
@@ -198,4 +198,4 @@
...
@@ -198,4 +198,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndReplace-upsert_pre_2.6.json
deleted
100644 → 0
View file @
762b6e90
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"maxServerVersion"
:
"2.4.99"
,
"tests"
:
[
{
"description"
:
"FindOneAndReplace when no documents match without id specified with upsert returning the document before modification"
,
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"x"
:
44
},
"projection"
:
{
"x"
:
1
,
"_id"
:
0
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
null
}
},
{
"description"
:
"FindOneAndReplace when no documents match without id specified with upsert returning the document after modification"
,
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"x"
:
44
},
"projection"
:
{
"x"
:
1
,
"_id"
:
0
},
"returnDocument"
:
"After"
,
"sort"
:
{
"x"
:
1
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
{
"x"
:
44
}
}
},
{
"description"
:
"FindOneAndReplace when no documents match with id specified with upsert returning the document before modification"
,
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"_id"
:
4
,
"x"
:
44
},
"projection"
:
{
"x"
:
1
,
"_id"
:
0
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
null
,
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
44
}
]
}
}
},
{
"description"
:
"FindOneAndReplace when no documents match with id specified with upsert returning the document after modification"
,
"operation"
:
{
"name"
:
"findOneAndReplace"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"_id"
:
4
,
"x"
:
44
},
"projection"
:
{
"x"
:
1
,
"_id"
:
0
},
"returnDocument"
:
"After"
,
"sort"
:
{
"x"
:
1
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
{
"x"
:
44
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
44
}
]
}
}
}
]
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndReplace.json
View file @
11a843eb
...
@@ -270,4 +270,4 @@
...
@@ -270,4 +270,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/
updateOne-pre_2.6
.json
→
tests/Collection/spec-tests/write/
findOneAndUpdate-arrayFilters
.json
View file @
11a843eb
...
@@ -2,162 +2,202 @@
...
@@ -2,162 +2,202 @@
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
"b"
:
1
}
]
}
}
],
],
"m
axServerVersion"
:
"2.4.99
"
,
"m
inServerVersion"
:
"3.5.6
"
,
"tests"
:
[
"tests"
:
[
{
{
"description"
:
"
UpdateOne when many documents match
"
,
"description"
:
"
FindOneAndUpdate when no document matches arrayFilters
"
,
"operation"
:
{
"operation"
:
{
"name"
:
"
updateOn
e"
,
"name"
:
"
findOneAndUpdat
e"
,
"arguments"
:
{
"arguments"
:
{
"filter"
:
{
"filter"
:
{},
"_id"
:
{
"$gt"
:
1
}
},
"update"
:
{
"update"
:
{
"$
inc
"
:
{
"$
set
"
:
{
"
x"
:
1
"
y.$[i].b"
:
2
}
}
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"upsertedCount"
:
0
}
}
},
{
"description"
:
"UpdateOne when one document matches"
,
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
},
"
update"
:
{
"
arrayFilters"
:
[
"$inc"
:
{
{
"
x"
:
1
"
i.b"
:
4
}
}
}
]
}
}
},
},
"outcome"
:
{
"outcome"
:
{
"result"
:
{
"result"
:
{
"matchedCount"
:
1
,
"_id"
:
1
,
"upsertedCount"
:
0
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
"collection"
:
{
"collection"
:
{
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
12
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
"b"
:
1
}
]
}
}
]
]
}
}
}
}
},
},
{
{
"description"
:
"
UpdateOne when no documents match
"
,
"description"
:
"
FindOneAndUpdate when one document matches arrayFilters
"
,
"operation"
:
{
"operation"
:
{
"name"
:
"
updateOn
e"
,
"name"
:
"
findOneAndUpdat
e"
,
"arguments"
:
{
"arguments"
:
{
"filter"
:
{
"filter"
:
{},
"_id"
:
4
},
"update"
:
{
"update"
:
{
"$
inc
"
:
{
"$
set
"
:
{
"
x"
:
1
"
y.$[i].b"
:
2
}
}
}
},
"arrayFilters"
:
[
{
"i.b"
:
3
}
]
}
}
},
},
"outcome"
:
{
"outcome"
:
{
"result"
:
{
"result"
:
{
"matchedCount"
:
0
,
"_id"
:
1
,
"upsertedCount"
:
0
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
"collection"
:
{
"collection"
:
{
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
2
},
{
"b"
:
1
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
"b"
:
1
}
]
}
}
]
]
}
}
}
}
},
},
{
{
"description"
:
"
UpdateOne with upsert when no documents match
"
,
"description"
:
"
FindOneAndUpdate when multiple documents match arrayFilters
"
,
"operation"
:
{
"operation"
:
{
"name"
:
"
updateOn
e"
,
"name"
:
"
findOneAndUpdat
e"
,
"arguments"
:
{
"arguments"
:
{
"filter"
:
{
"filter"
:
{},
"_id"
:
4
},
"update"
:
{
"update"
:
{
"$
inc
"
:
{
"$
set
"
:
{
"
x"
:
1
"
y.$[i].b"
:
2
}
}
},
},
"upsert"
:
true
"arrayFilters"
:
[
{
"i.b"
:
1
}
]
}
}
},
},
"outcome"
:
{
"outcome"
:
{
"result"
:
{
"result"
:
{
"matchedCount"
:
0
,
"_id"
:
1
,
"upsertedCount"
:
1
,
"y"
:
[
"upsertedId"
:
4
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
"collection"
:
{
"collection"
:
{
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
3
},
{
"b"
:
2
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
},
"b"
:
1
{
}
"_id"
:
4
,
]
"x"
:
1
}
}
]
]
}
}
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndUpdate-collation.json
View file @
11a843eb
...
@@ -64,4 +64,4 @@
...
@@ -64,4 +64,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/findOneAndUpdate.json
View file @
11a843eb
...
@@ -376,4 +376,4 @@
...
@@ -376,4 +376,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/insertMany.json
View file @
11a843eb
...
@@ -49,4 +49,4 @@
...
@@ -49,4 +49,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/insertOne.json
View file @
11a843eb
...
@@ -36,4 +36,4 @@
...
@@ -36,4 +36,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/replaceOne-collation.json
View file @
11a843eb
...
@@ -50,4 +50,4 @@
...
@@ -50,4 +50,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/replaceOne-pre_2.6.json
deleted
100644 → 0
View file @
762b6e90
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"maxServerVersion"
:
"2.4.99"
,
"tests"
:
[
{
"description"
:
"ReplaceOne when many documents match"
,
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
{
"$gt"
:
1
}
},
"replacement"
:
{
"x"
:
111
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"upsertedCount"
:
0
}
}
},
{
"description"
:
"ReplaceOne when one document matches"
,
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
1
},
"replacement"
:
{
"_id"
:
1
,
"x"
:
111
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"upsertedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
111
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
},
{
"description"
:
"ReplaceOne when no documents match"
,
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"_id"
:
4
,
"x"
:
1
}
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
0
,
"upsertedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
]
}
}
},
{
"description"
:
"ReplaceOne with upsert when no documents match without an id specified"
,
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"x"
:
1
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
0
,
"upsertedCount"
:
1
}
}
},
{
"description"
:
"ReplaceOne with upsert when no documents match with an id specified"
,
"operation"
:
{
"name"
:
"replaceOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"_id"
:
4
,
"x"
:
1
},
"upsert"
:
true
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
0
,
"upsertedCount"
:
1
,
"upsertedId"
:
4
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
1
}
]
}
}
}
]
}
\ No newline at end of file
tests/Collection/spec-tests/write/replaceOne-upsert.json
deleted
100644 → 0
View file @
762b6e90
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
}
],
"minServerVersion"
:
"2.6"
,
"tests"
:
[
{
"description"
:
"ReplaceOne with upsert when no documents match without an id specified"
,
"operation"
:
{
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"x"
:
1
},
"upsert"
:
true
},
"name"
:
"replaceOne"
},
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
1
}
]
},
"result"
:
{
"matchedCount"
:
0
,
"modifiedCount"
:
0
,
"upsertedId"
:
4
}
}
},
{
"description"
:
"ReplaceOne with upsert when no documents match with an id specified"
,
"operation"
:
{
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"replacement"
:
{
"_id"
:
4
,
"x"
:
1
},
"upsert"
:
true
},
"name"
:
"replaceOne"
},
"outcome"
:
{
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
11
},
{
"_id"
:
2
,
"x"
:
22
},
{
"_id"
:
3
,
"x"
:
33
},
{
"_id"
:
4
,
"x"
:
1
}
]
},
"result"
:
{
"matchedCount"
:
0
,
"modifiedCount"
:
0
,
"upsertedId"
:
4
}
}
}
]
}
tests/Collection/spec-tests/write/replaceOne.json
View file @
11a843eb
...
@@ -202,4 +202,4 @@
...
@@ -202,4 +202,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/updateMany-
pre_2.6
.json
→
tests/Collection/spec-tests/write/updateMany-
arrayFilters
.json
View file @
11a843eb
...
@@ -2,178 +2,181 @@
...
@@ -2,178 +2,181 @@
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
"b"
:
1
}
]
}
}
],
],
"m
axServerVersion"
:
"2.4.99
"
,
"m
inServerVersion"
:
"3.5.6
"
,
"tests"
:
[
"tests"
:
[
{
{
"description"
:
"UpdateMany when
many documents match
"
,
"description"
:
"UpdateMany when
no documents match arrayFilters
"
,
"operation"
:
{
"operation"
:
{
"name"
:
"updateMany"
,
"name"
:
"updateMany"
,
"arguments"
:
{
"arguments"
:
{
"filter"
:
{
"filter"
:
{},
"_id"
:
{
"update"
:
{
"$gt"
:
1
"$set"
:
{
"y.$[i].b"
:
2
}
}
},
},
"
update"
:
{
"
arrayFilters"
:
[
"$inc"
:
{
{
"
x"
:
1
"
i.b"
:
4
}
}
}
]
}
}
},
},
"outcome"
:
{
"outcome"
:
{
"result"
:
{
"result"
:
{
"matchedCount"
:
2
,
"matchedCount"
:
2
,
"
upsert
edCount"
:
0
"
modifi
edCount"
:
0
},
},
"collection"
:
{
"collection"
:
{
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
23
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
34
{
"b"
:
1
}
]
}
}
]
]
}
}
}
}
},
},
{
{
"description"
:
"UpdateMany when one document matches"
,
"description"
:
"UpdateMany when one document matches
arrayFilters
"
,
"operation"
:
{
"operation"
:
{
"name"
:
"updateMany"
,
"name"
:
"updateMany"
,
"arguments"
:
{
"arguments"
:
{
"filter"
:
{
"filter"
:
{},
"_id"
:
1
},
"update"
:
{
"update"
:
{
"$
inc
"
:
{
"$
set
"
:
{
"
x"
:
1
"
y.$[i].b"
:
2
}
}
}
},
}
"arrayFilters"
:
[
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"upsertedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"x"
:
12
},
{
"_id"
:
2
,
"x"
:
22
},
{
{
"_id"
:
3
,
"i.b"
:
3
"x"
:
33
}
}
]
]
}
}
}
},
{
"description"
:
"UpdateMany when no documents match"
,
"operation"
:
{
"name"
:
"updateMany"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
4
},
"update"
:
{
"$inc"
:
{
"x"
:
1
}
}
}
},
},
"outcome"
:
{
"outcome"
:
{
"result"
:
{
"result"
:
{
"matchedCount"
:
0
,
"matchedCount"
:
2
,
"
upsertedCount"
:
0
"
modifiedCount"
:
1
},
},
"collection"
:
{
"collection"
:
{
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
2
},
{
"b"
:
1
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
"b"
:
1
}
]
}
}
]
]
}
}
}
}
},
},
{
{
"description"
:
"UpdateMany w
ith upsert when no documents match
"
,
"description"
:
"UpdateMany w
hen multiple documents match arrayFilters
"
,
"operation"
:
{
"operation"
:
{
"name"
:
"updateMany"
,
"name"
:
"updateMany"
,
"arguments"
:
{
"arguments"
:
{
"filter"
:
{
"filter"
:
{},
"_id"
:
4
},
"update"
:
{
"update"
:
{
"$
inc
"
:
{
"$
set
"
:
{
"
x"
:
1
"
y.$[i].b"
:
2
}
}
},
},
"upsert"
:
true
"arrayFilters"
:
[
{
"i.b"
:
1
}
]
}
}
},
},
"outcome"
:
{
"outcome"
:
{
"result"
:
{
"result"
:
{
"matchedCount"
:
0
,
"matchedCount"
:
2
,
"upsertedCount"
:
1
,
"modifiedCount"
:
2
"upsertedId"
:
4
},
},
"collection"
:
{
"collection"
:
{
"data"
:
[
"data"
:
[
{
{
"_id"
:
1
,
"_id"
:
1
,
"x"
:
11
"y"
:
[
{
"b"
:
3
},
{
"b"
:
2
}
]
},
},
{
{
"_id"
:
2
,
"_id"
:
2
,
"x"
:
22
"y"
:
[
},
{
{
"b"
:
0
"_id"
:
3
,
},
"x"
:
33
{
},
"b"
:
2
{
}
"_id"
:
4
,
]
"x"
:
1
}
}
]
]
}
}
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/updateMany-collation.json
View file @
11a843eb
...
@@ -59,4 +59,4 @@
...
@@ -59,4 +59,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/updateMany.json
View file @
11a843eb
...
@@ -180,4 +180,4 @@
...
@@ -180,4 +180,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/updateOne-arrayFilters.json
0 → 100644
View file @
11a843eb
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
},
{
"_id"
:
3
,
"y"
:
[
{
"b"
:
5
,
"c"
:
[
{
"d"
:
2
},
{
"d"
:
1
}
]
}
]
}
],
"minServerVersion"
:
"3.5.6"
,
"tests"
:
[
{
"description"
:
"UpdateOne when no document matches arrayFilters"
,
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{},
"update"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
},
"arrayFilters"
:
[
{
"i.b"
:
4
}
]
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
},
{
"_id"
:
3
,
"y"
:
[
{
"b"
:
5
,
"c"
:
[
{
"d"
:
2
},
{
"d"
:
1
}
]
}
]
}
]
}
}
},
{
"description"
:
"UpdateOne when one document matches arrayFilters"
,
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{},
"update"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
},
"arrayFilters"
:
[
{
"i.b"
:
3
}
]
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
2
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
},
{
"_id"
:
3
,
"y"
:
[
{
"b"
:
5
,
"c"
:
[
{
"d"
:
2
},
{
"d"
:
1
}
]
}
]
}
]
}
}
},
{
"description"
:
"UpdateOne when multiple documents match arrayFilters"
,
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{},
"update"
:
{
"$set"
:
{
"y.$[i].b"
:
2
}
},
"arrayFilters"
:
[
{
"i.b"
:
1
}
]
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
3
},
{
"b"
:
2
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
},
{
"_id"
:
3
,
"y"
:
[
{
"b"
:
5
,
"c"
:
[
{
"d"
:
2
},
{
"d"
:
1
}
]
}
]
}
]
}
}
},
{
"description"
:
"UpdateOne when no documents match multiple arrayFilters"
,
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
},
"update"
:
{
"$set"
:
{
"y.$[i].c.$[j].d"
:
0
}
},
"arrayFilters"
:
[
{
"i.b"
:
5
},
{
"j.d"
:
3
}
]
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
0
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
},
{
"_id"
:
3
,
"y"
:
[
{
"b"
:
5
,
"c"
:
[
{
"d"
:
2
},
{
"d"
:
1
}
]
}
]
}
]
}
}
},
{
"description"
:
"UpdateOne when one document matches multiple arrayFilters"
,
"operation"
:
{
"name"
:
"updateOne"
,
"arguments"
:
{
"filter"
:
{
"_id"
:
3
},
"update"
:
{
"$set"
:
{
"y.$[i].c.$[j].d"
:
0
}
},
"arrayFilters"
:
[
{
"i.b"
:
5
},
{
"j.d"
:
1
}
]
}
},
"outcome"
:
{
"result"
:
{
"matchedCount"
:
1
,
"modifiedCount"
:
1
},
"collection"
:
{
"data"
:
[
{
"_id"
:
1
,
"y"
:
[
{
"b"
:
3
},
{
"b"
:
1
}
]
},
{
"_id"
:
2
,
"y"
:
[
{
"b"
:
0
},
{
"b"
:
1
}
]
},
{
"_id"
:
3
,
"y"
:
[
{
"b"
:
5
,
"c"
:
[
{
"d"
:
2
},
{
"d"
:
0
}
]
}
]
}
]
}
}
}
]
}
tests/Collection/spec-tests/write/updateOne-collation.json
View file @
11a843eb
...
@@ -51,4 +51,4 @@
...
@@ -51,4 +51,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
tests/Collection/spec-tests/write/updateOne.json
View file @
11a843eb
...
@@ -164,4 +164,4 @@
...
@@ -164,4 +164,4 @@
}
}
}
}
]
]
}
}
\ No newline at end of file
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