Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.2
    • Component/s: Write Ops
    • Labels:
      None

      Description

      You can now limit the resulting elements in the array after you push. The new syntax is :

      db.coll.update({...}, {$push: { $each:[<values>], $slice:-N, $sort:{...}}}

      The initial implementation (see SERVER-8069 for more) only supports negative slice (taking stuff from the end of the array).

      Sorting is by embedded document fields and doesn't work any type which is not an embedded docs (in the array).

        Attachments

          Issue Links

            Activity

              People

                Dates

                • Created:
                  Updated:
                  Resolved: