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

$push() to front of array

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • Write Ops
    • None

    Description

      Currently $push() only pushes items onto the end of the array.
      It would be nice if we could pass an optional boolean parameter that would allow pushing to the front of the array instead.

      This would allow reversing the order of arrays by nature of the front-push update, and would eliminate the need to do any client side sorting or reversing.
      Currently adding array items atomically in reverse chronological order is not possible.

      This is similar to SERVER-2036, and having an $insert() would accomplish the same thing.
      But more specific and easier.

      Attachments

        Issue Links

          Activity

            People

              scotthernandez Scott Hernandez (Inactive)
              sym3tri Ed Rooth
              Votes:
              8 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: