Misleading error message on incorrect $lookup

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • ALL
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This error message is confusing and misleading:

      db.lineitem.aggregate([{'$lookup': {'from': 'orders', as: 'orders'}}]);
      
      MongoServerError[FailedToParse]: $lookup requires both or neither of 'localField' and 'foreignField' to be specified 

      The query satisfies the "neither" condition, so the error message is incorrect. The problem with this query is that the pipeline argument to $lookup is missing.

            Assignee:
            Sidarth Krishna
            Reporter:
            Philip Stoev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: