@@ -284,12 +284,17 @@ Example return::
284
284
285
285
286
286
Server version between 2.7.6 (inclusive) and 4.0 (exclusive) do not support
287
- the ``nameOnly `` option for the ``listCollections `` command and will ignore it
288
- without raising an error. Therefore, drivers MUST always specify the ``nameOnly ``
289
- option when they only intend to access collection names from the ``listCollections ``
287
+ the ``nameOnly `` option for the ``listCollections `` command and will ignore it
288
+ without raising an error. Therefore, drivers MUST always specify the ``nameOnly ``
289
+ option when they only intend to access collection names from the ``listCollections ``
290
290
command result, except drivers MUST NOT set ``nameOnly `` if a filter
291
291
specifies any keys other than ``name ``.
292
292
293
+ MongoDB 4.0 also added an ``authorizedCollections `` boolean option to the ``listCollections ``
294
+ command, which can be used to limit the command result to only include collections
295
+ the user is authorized to use. Drivers MAY allow users to set the ``authorizedCollections ``
296
+ option on the ``listCollectionNames `` method.
297
+
293
298
Getting Full Collection Information
294
299
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295
300
@@ -342,7 +347,8 @@ Example return (a cursor which returns documents, not a simple array)::
342
347
When returning this information as a cursor, a driver SHOULD use the
343
348
method name ``listCollections `` or an idiomatic variant.
344
349
345
- Drivers MAY allow ``nameOnly `` option to be passed when executing the ``listCollections `` command for this method.
350
+ Drivers MAY allow the ``nameOnly `` and ``authorizedCollections `` options
351
+ to be passed when executing the ``listCollections `` command for this method.
346
352
347
353
Returning a List of Collection Objects
348
354
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -362,8 +368,12 @@ Example return (in PHP, but abbreviated)::
362
368
[5] => class MongoCollection#11 { }
363
369
}
364
370
365
- Drivers MUST specify the ``nameOnly `` option when executing the ``listCollections `` command for this method,
366
- except drivers MUST NOT set ``nameOnly `` if a filter specifies any keys other than ``name ``.
371
+ Drivers MUST specify true for the ``nameOnly `` option when executing the
372
+ ``listCollections `` command for this method, except drivers MUST NOT set
373
+ ``nameOnly `` if a filter specifies any keys other than ``name ``.
374
+
375
+ Drivers MAY allow the ``authorizedCollections `` option to be passed when
376
+ executing the ``listCollections `` command for this method
367
377
368
378
Replica Sets
369
379
~~~~~~~~~~~~
@@ -433,6 +443,9 @@ The shell implements the first algorithm for falling back if the
433
443
434
444
Version History
435
445
===============
446
+ Version 0.7.0 Changes
447
+ - Support ``authorizedCollections `` option in ``listCollections `` command.
448
+
436
449
Version 0.6.1 Changes
437
450
- Update to use secondaryOk.
438
451
@@ -449,7 +462,7 @@ Version 0.5 Changes
449
462
- Clarify that ``nameOnly `` must not be used with filters other than ``name ``.
450
463
451
464
Version 0.4 Changes
452
- - SPEC-1066: Support ``nameOnly `` option in ``listCollections `` command.
465
+ - SPEC-1066: Support ``nameOnly `` option in ``listCollections `` command.
453
466
454
467
Version 0.3.1 Changes
455
468
0 commit comments