Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-22053

Insertion of Array with undefined/null components.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.2.14, 3.3.11
    • Affects Version/s: 3.2.0
    • Component/s: Shell
    • Fully Compatible
    • ALL
    • v3.2
    • Hide

      Previously to 3.2 when this happened

      var s = []
      s[1] = 1
      print(s) => [ undefined, 1]
      db.colll.insert(

      {mys:s}

      )

      you would get a doc like this:

      { mys: [ null, 1] }

      now in v3.2 you get this document:

      { mys: [1] }

      So the data has shifted up an index.

      Is this a new BUG or an old BUG fixed - cannot find any reference to it elsewhere.

      ====

      fyi:
      It has played havoc with some of my Map Reductions which rely on the specific placement of values in an array against a standard header array which I use to populate the array i.e.
      value.arr[ header.indexOf( this.term ) ] = this.avalue;
      emit(..., value)

      I think that there might be an insert between the map and reduction where the array is restructured.

      Show
      Previously to 3.2 when this happened var s = [] s [1] = 1 print(s) => [ undefined, 1] db.colll.insert( {mys:s} ) you would get a doc like this: { mys: [ null, 1] } now in v3.2 you get this document: { mys: [1] } So the data has shifted up an index. Is this a new BUG or an old BUG fixed - cannot find any reference to it elsewhere. ==== fyi: It has played havoc with some of my Map Reductions which rely on the specific placement of values in an array against a standard header array which I use to populate the array i.e. value.arr[ header.indexOf( this.term ) ] = this.avalue; emit(..., value) I think that there might be an insert between the map and reduction where the array is restructured.
    • Platforms 18 (08/05/16)
    • 0

      Inserts of arrays with undefined/null content in positions are being treated differently in version 3.2.

            Assignee:
            waley.chen Waley Chen
            Reporter:
            paul.reed Paul Reed
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: