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

Insertion of Array with undefined/null components.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.2.14, 3.3.11
    • Component/s: Shell
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.2
    • Steps To Reproduce:
      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.
    • Sprint:
      Platforms 18 (08/05/16)
    • Linked BF Score:
      0

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: