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

        Issue Links

          Activity

          Hide
          auto auto (Inactive) added a comment -

          Author:

          {u'date': u'2013-01-15T22:53:57Z', u'email': u'alerner@10gen.com', u'name': u'Alberto Lerner'}

          Message: SERVER-8008 Fixed uassert numbers.
          Branch: master
          https://github.com/mongodb/mongo/commit/09139c400d9fe5a6a0d19764395f22b4333e761f

          Show
          auto auto (Inactive) added a comment - Author: {u'date': u'2013-01-15T22:53:57Z', u'email': u'alerner@10gen.com', u'name': u'Alberto Lerner'} Message: SERVER-8008 Fixed uassert numbers. Branch: master https://github.com/mongodb/mongo/commit/09139c400d9fe5a6a0d19764395f22b4333e761f
          Hide
          yfinkelstein Yuri Finkelstein added a comment -

          Thanks for making this happen. This is a great feature, but perhaps it would require a bit more effort to explain folks what can be done with it. This is in fact a perfect instrument for MVCC-type writes against Mongo. Also, many messaging systems do not guarantee in-order delivery. So, if a user app is storing data to mongo in response to message receipt but needs to order the result in some way (by timestamp, sequence counter, etc) it now can do it with this instrument. Ability to trim the array is paramount to avoid unbounded document growth. I think you need to publicize what these interesting potential applications of this feature.

          Show
          yfinkelstein Yuri Finkelstein added a comment - Thanks for making this happen. This is a great feature, but perhaps it would require a bit more effort to explain folks what can be done with it. This is in fact a perfect instrument for MVCC-type writes against Mongo. Also, many messaging systems do not guarantee in-order delivery. So, if a user app is storing data to mongo in response to message receipt but needs to order the result in some way (by timestamp, sequence counter, etc) it now can do it with this instrument. Ability to trim the array is paramount to avoid unbounded document growth. I think you need to publicize what these interesting potential applications of this feature.
          Hide
          alerner Alberto Lerner (Inactive) added a comment -

          Yuri, when can we read your g+ post about those usage cases?

          Show
          alerner Alberto Lerner (Inactive) added a comment - Yuri, when can we read your g+ post about those usage cases?
          Hide
          yfinkelstein Yuri Finkelstein added a comment - - edited

          What's g+? Google plus? I barely use it. I can talk about this at MongoSF later this year.

          Show
          yfinkelstein Yuri Finkelstein added a comment - - edited What's g+? Google plus? I barely use it. I can talk about this at MongoSF later this year.
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

          Message: Revert "SERVER-8008: $unwind of scalar should return 1 doc with scalar"

          This reverts commit 25feddadeef43fb0668350b40282fcdfbb1f2296.
          Branch: master
          https://github.com/mongodb/mongo/commit/5ad411b38b020b209218017448426e9dc72382b5

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'} Message: Revert " SERVER-8008 : $unwind of scalar should return 1 doc with scalar" This reverts commit 25feddadeef43fb0668350b40282fcdfbb1f2296. Branch: master https://github.com/mongodb/mongo/commit/5ad411b38b020b209218017448426e9dc72382b5

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                16 weeks, 3 days ago
                Date of 1st Reply: