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

    • Fully Compatible
    • ALL
    • Query 2016-11-21

      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.

            Assignee:
            james.wahlin@mongodb.com James Wahlin
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: