$getField accepts all input types and treats all non-object ones as null-ish

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      db.getFieldTest.aggregate(\{$project:{o1:{$getField:{input:"$_id", field:"x"}}}})
      { "_id" : ObjectId("66e8738aee1179b743aff3cd") }
      { "_id" : ObjectId("66e87391ee1179b743aff3ce") }
      
      

      All non-objects seem to lead to same outcome.  Design doc said:

      The ‘input’ argument is optional and defaults to $$CURRENT. A query fatal exception is thrown if it evaluates to anything other than missing, null, undefined, or Object. 

              Assignee:
              Unassigned
              Reporter:
              Asya Kamsky
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: