Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15788

[SERVER] getCollectionInfos nameOnly param has document type, not boolean

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            baryshok@astraload.com Denis Baryshok
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              7 weeks, 4 days ago