Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27030

Improve the error message when issuing a legacy find/getMore on a view

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.0-rc3
    • Fix Version/s: 3.4.0-rc4
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Query 2016-11-21

      Description

      When performing a legacy find, getMore or killCursors on a view, users get the error message "Namespace <view> is a view, not a collection". For example, in the shell,

      > db.getMongo().forceReadMode("legacy");
      > db.view.find().toArray();
      2016-11-14T18:52:32.559-0500 E QUERY    [main] Error: error: { "$err" : "Namespace test.view is a view, not a collection", "code" : 166 } :
      _getErrorWithCode@src/mongo/shell/utils.js:25:13
      DBQuery.prototype.next@src/mongo/shell/query.js:309:1
      DBQuery.prototype.toArray@src/mongo/shell/query.js:338:16
      @(shell):1:1
      

      This is rather unhelpful from a user's standpoint. We should consider making this error more user-friendly and explicitly state that legacy find and getMore is not supported on a view.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: