arrayToObject should not error out on explicit value of null for value

XMLWordPrintableJSON

    • Minor Change
    • ALL
    • v3.4
    • Query 2017-07-10
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If my object is o:{ "foo": null } and {$objectToArray:"$o"} converts it to {k:"foo",v:null} then $arrayToObject must be able to convert it back to the object, but instead it gives the error:

      Error: command failed: {
      	"ok" : 0,
      	"errmsg" : "$arrayToObject requires an object with keys 'k' and 'v'. Missing either or both keys from: {k: \"comment\", v: null}",
      	"code" : 40393,
      	"codeName" : "Location40393"
      }
      

      Explicit null is a different type than missing, so we're probably checking for "nullish" when we should be checking for "missing".

              Assignee:
              Tess Avitabile (Inactive)
              Reporter:
              Asya Kamsky
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: