Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1182

Documentation for using Cursor.returnKey is incomplete, missing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.2.33
    • Fix Version/s: None
    • Component/s: None

      Description

      The official documentation for Cursor.returnKey does not explain what values can be passed to it.

      The cursor example for every method in the class shows "10" as a valid value, but does not explain what it means:
      collection.find({}).returnKey(10) // Set the cursor returnKey

      The doc for the method itself ends abruptly before explaining what value to pass it:
      {{/**

      • Set the cursor returnKey
      • @method
      • @param {object}

        returnKey Only return the index field or fields for the results of the query. If $returnKey is set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. Use one of the following forms:

      • @return {Cursor}

        */}}

      This is an issue with the documentation on the website as well, which matches the javascript documentation: http://mongodb.github.io/node-mongodb-native/2.2/api/Cursor.html#returnKey

        Attachments

          Activity

            People

            Assignee:
            rebecca.weinberger Rebecca Weinberger
            Reporter:
            james@rabb.it James Mitchell
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: