buggy behaviour for "[undefined]"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.4.10
    • Affects Version/s: 1.4.9
    • Component/s: None
    • Environment:
      ubuntu 12 LTS
    • 2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When I add a property

      { x: [ null ] }

      to a document, everything works well.
      But when I add a property

      { x: [ undefined ] }

      to a document (usually because of buggy javascript code, but anyway), the following happens :
      If requested from the mongo shell, the document shows as

      { x: [ null ] }

      .
      If requested from the node driver, the document shows in javascript as

      { x: [] }

      .
      Replacing undefined by null in the shell is dubious (but not the object of this report), but showing an empty array in node is a bug. Moreover, if I try to query documents with { "x.0": {$exists: true} }, it returns the document (with x an empty array...), and with { "x.0": {$exists: false} } it doesn't return anything.

            Assignee:
            Christian Amor Kvalheim
            Reporter:
            Seb
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: