Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3028

Make note in the 2.6 compatibility about change of agg helper in the shell returns cursor

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • v1.3.3
    • manual
    • 4
    • true

    Description

      This change can take users by surprise when their scripts suddenly stop working when they upgrade.

      For example, this command in the shell would need to remove the result after the command.

      2.4:

      db.chunks.aggregate( 
      { $group : { _id : { "ns" : "$ns" , "shard" : "$shard" }, total  : { $sum : 1 } } }, 
      { $sort : { "_id.ns" : 1, "_id.shard" : 1 } } ).result.forEach( function(x) {print("foo");} );

      Change to this in 2.6:

      db.chunks.aggregate( 
      { $group : { _id : { "ns" : "$ns" , "shard" : "$shard" }, total  : { $sum : 1 } } }, 
      { $sort : { "_id.ns" : 1, "_id.shard" : 1 } } ).forEach( function(x) {print("foo");} );

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            dan@mongodb.com Daniel Pasette
            Jonathan Dahl Jonathan Dahl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 13 weeks, 3 days ago