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

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

    XMLWordPrintableJSON

Details

    • Task
    • Status: Backlog
    • Minor - P4
    • Resolution: Unresolved
    • 5.0.6
    • None
    • manual, mongosh, Server
    • None
    • MacOS 13.0.1, MongoDB Shell 1.6.1, Mongod 5.0.6

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            baryshok@astraload.com Denis Baryshok
            Emet Ozar Emet Ozar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              15 weeks, 3 days ago