mongo 2.16.2 → 2.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mongo/collection/view/iterable.rb +17 -1
- data/lib/mongo/collection/view.rb +1 -0
- data/lib/mongo/query_cache.rb +12 -2
- data/lib/mongo/server/monitor/connection.rb +10 -4
- data/lib/mongo/version.rb +1 -1
- data/spec/integration/find_options_spec.rb +227 -0
- data/spec/integration/query_cache_spec.rb +159 -0
- data/spec/integration/sdam_events_spec.rb +40 -0
- data/spec/mongo/collection/view/readable_spec.rb +56 -0
- data/spec/mongo/query_cache_spec.rb +165 -0
- data/spec/shared/share/Dockerfile.erb +3 -3
- data/spec/shared/shlib/server.sh +1 -1
- data/spec/support/certificates/atlas-ocsp-ca.crt +40 -47
- data/spec/support/certificates/atlas-ocsp.crt +101 -106
- data.tar.gz.sig +0 -0
- metadata +1049 -1042
- metadata.gz.sig +0 -0
@@ -191,6 +191,14 @@ describe Mongo::QueryCache do
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
+
context 'when the query has a limit but negative' do
|
195
|
+
let(:limit) { -5 }
|
196
|
+
|
197
|
+
it 'returns the caching cursor' do
|
198
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
194
202
|
context 'when the query has no limit' do
|
195
203
|
let(:limit) { nil }
|
196
204
|
|
@@ -198,6 +206,65 @@ describe Mongo::QueryCache do
|
|
198
206
|
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
199
207
|
end
|
200
208
|
end
|
209
|
+
|
210
|
+
context 'when the query has a 0 limit' do
|
211
|
+
let(:limit) { 0 }
|
212
|
+
|
213
|
+
it 'returns the caching cursor' do
|
214
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
context 'when that entry has a 0 limit' do
|
220
|
+
let(:caching_cursor_options) do
|
221
|
+
{
|
222
|
+
namespace: 'db.coll',
|
223
|
+
selector: { field: 'value' },
|
224
|
+
limit: 0,
|
225
|
+
}
|
226
|
+
end
|
227
|
+
|
228
|
+
let(:query_options) do
|
229
|
+
caching_cursor_options.merge(limit: limit)
|
230
|
+
end
|
231
|
+
|
232
|
+
before do
|
233
|
+
allow(view).to receive(:limit) { 0 }
|
234
|
+
end
|
235
|
+
|
236
|
+
context 'when the query has a limit' do
|
237
|
+
let(:limit) { 5 }
|
238
|
+
|
239
|
+
it 'returns the caching cursor' do
|
240
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
context 'when the query has a limit but negative' do
|
245
|
+
let(:limit) { -5 }
|
246
|
+
|
247
|
+
it 'returns the caching cursor' do
|
248
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
|
253
|
+
context 'when the query has no limit' do
|
254
|
+
let(:limit) { nil }
|
255
|
+
|
256
|
+
it 'returns the caching cursor' do
|
257
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
context 'when the query has a 0 limit' do
|
262
|
+
let(:limit) { 0 }
|
263
|
+
|
264
|
+
it 'returns the caching cursor' do
|
265
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
266
|
+
end
|
267
|
+
end
|
201
268
|
end
|
202
269
|
|
203
270
|
context 'when that entry has a limit' do
|
@@ -225,6 +292,14 @@ describe Mongo::QueryCache do
|
|
225
292
|
end
|
226
293
|
end
|
227
294
|
|
295
|
+
context 'and the new query has a smaller limit but negative' do
|
296
|
+
let(:limit) { -4 }
|
297
|
+
|
298
|
+
it 'returns the caching cursor' do
|
299
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
228
303
|
context 'and the new query has a larger limit' do
|
229
304
|
let(:limit) { 6 }
|
230
305
|
|
@@ -233,6 +308,14 @@ describe Mongo::QueryCache do
|
|
233
308
|
end
|
234
309
|
end
|
235
310
|
|
311
|
+
context 'and the new query has a larger limit but negative' do
|
312
|
+
let(:limit) { -6 }
|
313
|
+
|
314
|
+
it 'returns nil' do
|
315
|
+
expect(Mongo::QueryCache.get(**query_options)).to be_nil
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
236
319
|
context 'and the new query has the same limit' do
|
237
320
|
let(:limit) { 5 }
|
238
321
|
|
@@ -241,6 +324,80 @@ describe Mongo::QueryCache do
|
|
241
324
|
end
|
242
325
|
end
|
243
326
|
|
327
|
+
context 'and the new query has the same limit but negative' do
|
328
|
+
let(:limit) { -5 }
|
329
|
+
|
330
|
+
it 'returns the caching cursor' do
|
331
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
context 'and the new query has no limit' do
|
336
|
+
let(:limit) { nil }
|
337
|
+
|
338
|
+
it 'returns nil' do
|
339
|
+
expect(Mongo::QueryCache.get(**query_options)).to be_nil
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
context 'and the new query has a 0 limit' do
|
344
|
+
let(:limit) { 0 }
|
345
|
+
|
346
|
+
it 'returns nil' do
|
347
|
+
expect(Mongo::QueryCache.get(**query_options)).to be_nil
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
context 'when that entry has a negative limit' do
|
353
|
+
let(:caching_cursor_options) do
|
354
|
+
{
|
355
|
+
namespace: 'db.coll',
|
356
|
+
selector: { field: 'value' },
|
357
|
+
limit: -5,
|
358
|
+
}
|
359
|
+
end
|
360
|
+
|
361
|
+
let(:query_options) do
|
362
|
+
caching_cursor_options.merge(limit: limit)
|
363
|
+
end
|
364
|
+
|
365
|
+
before do
|
366
|
+
allow(view).to receive(:limit) { -5 }
|
367
|
+
end
|
368
|
+
|
369
|
+
context 'and the new query has a smaller limit' do
|
370
|
+
let(:limit) { 4 }
|
371
|
+
|
372
|
+
it 'returns the caching cursor' do
|
373
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
context 'and the new query has a larger limit' do
|
378
|
+
let(:limit) { 6 }
|
379
|
+
|
380
|
+
it 'returns nil' do
|
381
|
+
expect(Mongo::QueryCache.get(**query_options)).to be_nil
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
context 'and the new query has the same negative limit' do
|
386
|
+
let(:limit) { -5 }
|
387
|
+
|
388
|
+
it 'returns the caching cursor' do
|
389
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
393
|
+
context 'and the new query has the same positive limit' do
|
394
|
+
let(:limit) { 5 }
|
395
|
+
|
396
|
+
it 'returns the caching cursor' do
|
397
|
+
expect(Mongo::QueryCache.get(**query_options)).to eq(caching_cursor)
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
244
401
|
context 'and the new query has no limit' do
|
245
402
|
let(:limit) { nil }
|
246
403
|
|
@@ -248,6 +405,14 @@ describe Mongo::QueryCache do
|
|
248
405
|
expect(Mongo::QueryCache.get(**query_options)).to be_nil
|
249
406
|
end
|
250
407
|
end
|
408
|
+
|
409
|
+
context 'and the new query has a 0 limit' do
|
410
|
+
let(:limit) { 0 }
|
411
|
+
|
412
|
+
it 'returns nil' do
|
413
|
+
expect(Mongo::QueryCache.get(**query_options)).to be_nil
|
414
|
+
end
|
415
|
+
end
|
251
416
|
end
|
252
417
|
end
|
253
418
|
end
|
@@ -233,13 +233,13 @@ CFG
|
|
233
233
|
# Current virtualenv fails with
|
234
234
|
# https://github.com/pypa/virtualenv/issues/1630
|
235
235
|
<% if distro =~ /ubuntu2004/ %>
|
236
|
-
RUN python3 -m pip install 'virtualenv<20' 'mtools-legacy[mlaunch]'
|
236
|
+
RUN python3 -m pip install 'virtualenv<20' 'mtools-legacy[mlaunch]==1.5.5'
|
237
237
|
<% else %>
|
238
|
-
RUN python2 -m pip install 'virtualenv<20' 'mtools-legacy[mlaunch]'
|
238
|
+
RUN python2 -m pip install 'virtualenv<20' 'mtools-legacy[mlaunch]==1.5.5'
|
239
239
|
<% end %>
|
240
240
|
|
241
241
|
RUN pip --version && \
|
242
|
-
pip install mtools-legacy[mlaunch]
|
242
|
+
pip install 'mtools-legacy[mlaunch]==1.5.5'
|
243
243
|
|
244
244
|
<% if @env.fetch('MONGODB_VERSION') >= '4.4' %>
|
245
245
|
# ubuntu1604 installs MarkupSafe 0.0.0 here instead of 2.0.0+
|
data/spec/shared/shlib/server.sh
CHANGED
@@ -2,16 +2,16 @@ Certificate:
|
|
2
2
|
Data:
|
3
3
|
Version: 3 (0x2)
|
4
4
|
Serial Number:
|
5
|
-
|
5
|
+
06:d8:d9:04:d5:58:43:46:f6:8a:2f:a7:54:22:7e:c4
|
6
6
|
Signature Algorithm: sha256WithRSAEncryption
|
7
7
|
Issuer: C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
|
8
8
|
Validity
|
9
|
-
Not Before:
|
10
|
-
Not After :
|
9
|
+
Not Before: Apr 14 00:00:00 2021 GMT
|
10
|
+
Not After : Apr 13 23:59:59 2031 GMT
|
11
11
|
Subject: C = US, O = DigiCert Inc, CN = DigiCert TLS RSA SHA256 2020 CA1
|
12
12
|
Subject Public Key Info:
|
13
13
|
Public Key Algorithm: rsaEncryption
|
14
|
-
|
14
|
+
Public-Key: (2048 bit)
|
15
15
|
Modulus:
|
16
16
|
00:c1:4b:b3:65:47:70:bc:dd:4f:58:db:ec:9c:ed:
|
17
17
|
c3:66:e5:1f:31:13:54:ad:4a:66:46:1f:2c:0a:ec:
|
@@ -33,57 +33,51 @@ Certificate:
|
|
33
33
|
99:f5
|
34
34
|
Exponent: 65537 (0x10001)
|
35
35
|
X509v3 extensions:
|
36
|
+
X509v3 Basic Constraints: critical
|
37
|
+
CA:TRUE, pathlen:0
|
36
38
|
X509v3 Subject Key Identifier:
|
37
39
|
B7:6B:A2:EA:A8:AA:84:8C:79:EA:B4:DA:0F:98:B2:C5:95:76:B9:F4
|
38
40
|
X509v3 Authority Key Identifier:
|
39
|
-
|
40
|
-
|
41
|
+
03:DE:50:35:56:D1:4C:BB:66:F0:A3:E2:1B:1B:C3:97:B2:3D:D1:55
|
41
42
|
X509v3 Key Usage: critical
|
42
43
|
Digital Signature, Certificate Sign, CRL Sign
|
43
44
|
X509v3 Extended Key Usage:
|
44
45
|
TLS Web Server Authentication, TLS Web Client Authentication
|
45
|
-
X509v3 Basic Constraints: critical
|
46
|
-
CA:TRUE, pathlen:0
|
47
46
|
Authority Information Access:
|
48
47
|
OCSP - URI:http://ocsp.digicert.com
|
49
48
|
CA Issuers - URI:http://cacerts.digicert.com/DigiCertGlobalRootCA.crt
|
50
|
-
|
51
49
|
X509v3 CRL Distribution Points:
|
52
|
-
|
53
50
|
Full Name:
|
54
51
|
URI:http://crl3.digicert.com/DigiCertGlobalRootCA.crl
|
55
|
-
|
56
|
-
Full Name:
|
57
|
-
URI:http://crl4.digicert.com/DigiCertGlobalRootCA.crl
|
58
|
-
|
59
52
|
X509v3 Certificate Policies:
|
53
|
+
Policy: 2.16.840.1.114412.2.1
|
60
54
|
Policy: 2.23.140.1.1
|
61
55
|
Policy: 2.23.140.1.2.1
|
62
56
|
Policy: 2.23.140.1.2.2
|
63
57
|
Policy: 2.23.140.1.2.3
|
64
|
-
|
65
58
|
Signature Algorithm: sha256WithRSAEncryption
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
59
|
+
Signature Value:
|
60
|
+
80:32:ce:5e:0b:dd:6e:5a:0d:0a:af:e1:d6:84:cb:c0:8e:fa:
|
61
|
+
85:70:ed:da:5d:b3:0c:f7:2b:75:40:fe:85:0a:fa:f3:31:78:
|
62
|
+
b7:70:4b:1a:89:58:ba:80:bd:f3:6b:1d:e9:7e:cf:0b:ba:58:
|
63
|
+
9c:59:d4:90:d3:fd:6c:fd:d0:98:6d:b7:71:82:5b:cf:6d:0b:
|
64
|
+
5a:09:d0:7b:de:c4:43:d8:2a:a4:de:9e:41:26:5f:bb:8f:99:
|
65
|
+
cb:dd:ae:e1:a8:6f:9f:87:fe:74:b7:1f:1b:20:ab:b1:4f:c6:
|
66
|
+
f5:67:5d:5d:9b:3c:e9:ff:69:f7:61:6c:d6:d9:f3:fd:36:c6:
|
67
|
+
ab:03:88:76:d2:4b:2e:75:86:e3:fc:d8:55:7d:26:c2:11:77:
|
68
|
+
df:3e:02:b6:7c:f3:ab:7b:7a:86:36:6f:b8:f7:d8:93:71:cf:
|
69
|
+
86:df:73:30:fa:7b:ab:ed:2a:59:c8:42:84:3b:11:17:1a:52:
|
70
|
+
f3:c9:0e:14:7d:a2:5b:72:67:ba:71:ed:57:47:66:c5:b8:02:
|
71
|
+
4a:65:34:5e:8b:d0:2a:3c:20:9c:51:99:4c:e7:52:9e:f7:6b:
|
72
|
+
11:2b:0d:92:7e:1d:e8:8a:eb:36:16:43:87:ea:2a:63:bf:75:
|
73
|
+
3f:eb:de:c4:03:bb:0a:3c:f7:30:ef:eb:af:4c:fc:8b:36:10:
|
74
|
+
73:3e:f3:a4
|
81
75
|
|
82
76
|
-----BEGIN CERTIFICATE-----
|
83
|
-
|
77
|
+
MIIEvjCCA6agAwIBAgIQBtjZBNVYQ0b2ii+nVCJ+xDANBgkqhkiG9w0BAQsFADBh
|
84
78
|
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
85
79
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