[DOCS-15788] [SERVER] getCollectionInfos nameOnly param has document type, not boolean Created: 13/Dec/22  Updated: 22/Jan/24

Status: Backlog
Project: Documentation
Component/s: manual, mongosh, Server
Affects Version/s: 5.0.6
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Denis Baryshok Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backlog, request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MacOS 13.0.1, MongoDB Shell 1.6.1, Mongod 5.0.6


Participants:
Days since reply: 1 year, 8 weeks, 1 day ago
Epic Link: DOCSP-11702

 Description   

Problem Statement/Rationale

Description of {{getCollectionInfos }}command's{{ nameOnly }}parameter is misleading in the documentation:

https://www.mongodb.com/docs/manual/reference/method/db.getCollectionInfos/#mongodb-method-db.getCollectionInfos

Documentation states that it has boolean type, but in fact it has document type:  {{

{ nameOnly: true }

}}

Steps to Reproduce

  1. Connect with {{mongosh}} to any database
  2. Run db.getCollectionInfos({}, true) command

Expected Results

It should return just the collection/view names and type.

Actual Results

It returns the collection/view names and all other information.

Additional Notes

But if we run db.getCollectionInfos({}, { nameOnly: true }), then we get the expected result.

Also, it's unclear where the 3rd parameter – authorizedCollections should go:

db.getCollectionInfos({}, { nameOnly: true, authorizedCollections: true })
 
// or
 
db.getCollectionInfos({}, { nameOnly: true }, { authorizedCollections: true })

Finally, documentation has 3 examples: https://www.mongodb.com/docs/manual/reference/method/db.getCollectionInfos/#example

but none of the examples show how to use{{ nameOnly }}or{{ authorizedCollections }}parameters.



 Comments   
Comment by Denis Baryshok [ 13/Dec/22 ]

Sorry for broken formatting in the description (I'm referring to "{{ ... }}" entries), I don't know where they came from, the description looked fine in the editor

Generated at Thu Feb 08 08:13:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.