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

      Now that SERVER-991 is resolved, more can be accomplished with this if Mongo would maintain arrays sorted by specified field.

      Let's say the initial document state was:

      {a: [{version: 1, data: 10}]}

      After

      { $push : { a : { $each : [ { version : 3, data : 6 } ] , $orderBy : {version : -1 }, $trimTo : 11 } } }

      it will be

      {a: [{version: 2, data: 6}, {version: 1, data: 10}]}

      After

      { $push : { a : { $each : [ { version : 2, data : 8 } ] , $orderBy : {version : -1 }, $trimTo : 11 } } }

      it will be

      {a: [{version: 3, data: 6}, {version: 2, data: 8}, {version: 1, data: 10}]}

      In this case,
      Mongo maintains array in "a" sorted by version in discending order and
      trims the array to 11 elements by dropping the very last element when
      required.

      The context here is that this mechanism would enable capability similar to
      http://hbase.apache.org/book/versions.html

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: