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

      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");} );
      

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

              Created:
              Updated:
              Resolved:
              10 years, 3 weeks, 6 days ago