Skip to content

Commit 686dcbe

Browse files
committed
PHPLIB-841: Tests for aggregate allowDiskUse option
Synced with mongodb/specifications#1178
1 parent aefff4c commit 686dcbe

File tree

1 file changed

+155
-0
lines changed

1 file changed

+155
-0
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
{
2+
"description": "aggregate-allowdiskuse",
3+
"schemaVersion": "1.0",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0",
8+
"observeEvents": [
9+
"commandStartedEvent"
10+
]
11+
}
12+
},
13+
{
14+
"database": {
15+
"id": "database0",
16+
"client": "client0",
17+
"databaseName": "crud-tests"
18+
}
19+
},
20+
{
21+
"collection": {
22+
"id": "collection0",
23+
"database": "database0",
24+
"collectionName": "coll0"
25+
}
26+
}
27+
],
28+
"initialData": [
29+
{
30+
"collectionName": "coll0",
31+
"databaseName": "crud-tests",
32+
"documents": []
33+
}
34+
],
35+
"tests": [
36+
{
37+
"description": "Aggregate does not send allowDiskuse when value is not specified",
38+
"operations": [
39+
{
40+
"object": "collection0",
41+
"name": "aggregate",
42+
"arguments": {
43+
"pipeline": [
44+
{
45+
"$match": {}
46+
}
47+
]
48+
}
49+
}
50+
],
51+
"expectEvents": [
52+
{
53+
"client": "client0",
54+
"events": [
55+
{
56+
"commandStartedEvent": {
57+
"command": {
58+
"aggregate": "coll0",
59+
"pipeline": [
60+
{
61+
"$match": {}
62+
}
63+
],
64+
"allowDiskUse": {
65+
"$$exists": false
66+
}
67+
},
68+
"commandName": "aggregate",
69+
"databaseName": "crud-tests"
70+
}
71+
}
72+
]
73+
}
74+
]
75+
},
76+
{
77+
"description": "Aggregate sends allowDiskuse false when false is specified",
78+
"operations": [
79+
{
80+
"object": "collection0",
81+
"name": "aggregate",
82+
"arguments": {
83+
"pipeline": [
84+
{
85+
"$match": {}
86+
}
87+
],
88+
"allowDiskUse": false
89+
}
90+
}
91+
],
92+
"expectEvents": [
93+
{
94+
"client": "client0",
95+
"events": [
96+
{
97+
"commandStartedEvent": {
98+
"command": {
99+
"aggregate": "coll0",
100+
"pipeline": [
101+
{
102+
"$match": {}
103+
}
104+
],
105+
"allowDiskUse": false
106+
},
107+
"commandName": "aggregate",
108+
"databaseName": "crud-tests"
109+
}
110+
}
111+
]
112+
}
113+
]
114+
},
115+
{
116+
"description": "Aggregate sends allowDiskuse true when true is specified",
117+
"operations": [
118+
{
119+
"object": "collection0",
120+
"name": "aggregate",
121+
"arguments": {
122+
"pipeline": [
123+
{
124+
"$match": {}
125+
}
126+
],
127+
"allowDiskUse": true
128+
}
129+
}
130+
],
131+
"expectEvents": [
132+
{
133+
"client": "client0",
134+
"events": [
135+
{
136+
"commandStartedEvent": {
137+
"command": {
138+
"aggregate": "coll0",
139+
"pipeline": [
140+
{
141+
"$match": {}
142+
}
143+
],
144+
"allowDiskUse": true
145+
},
146+
"commandName": "aggregate",
147+
"databaseName": "crud-tests"
148+
}
149+
}
150+
]
151+
}
152+
]
153+
}
154+
]
155+
}

0 commit comments

Comments
 (0)