Inserting a unique value into a specific position in an array

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Inserting an item of any type into a specific postion into existing array structure

      Currently $push only appends data to an array.
      But there is no function to insert an array into a specific postion.

      Example data (Python array)

      Before:
      [ [Item1, 0, 0], [Item2, 0, 0].. ] # Array items inside an array

      Command for example can be
      { '$insert':

      { 'myArray.1': [item3, 0,0 ] }

      } # At position 1 of the myArray

      Result:
      [ [Item1, 0,0], [Item3, 0,0], [Item2, 0,0] ]

      $push is out of question as the data should be inserted to keep a order of the items.

            Assignee:
            Unassigned
            Reporter:
            Jan Riechers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: