Files
mongo/jstests/aggregation/disabled/server5369.js
Mathias Stearn 061a086641 SERVER-10165 aggregate() shell helper now returns a cursor
The actual change is in src/mongo/shell/collection.js with the remaining changes
to adjust tests to the new api.

The "ideal" arguments are now an array of pipeline ops and an optional object
with extra top-level options for the command (such as {explain: true}. For
backwards compatibility, we still support the varargs style where each argument
is a pipeline stage, but there is no way to specify extra parameters in this
mode.
2013-10-08 17:35:02 -04:00

14 lines
427 B
JavaScript

// https://jira.mongodb.org/browse/SERVER-5369
// make sure excluding a field doesnt cause _id to appear twice
// use the aggregation test db
db = db.getSiblingDB('aggdb');
// empty and populate
db.test.drop();
db.test.save({a:1,b:2})
// agg with exclusion than ensure fields are only the two we expect
var f = db.test.aggregate({$project:{a:0}});
assert.eq(["_id","b"], Object.keySet(f.toArray()[0]), "server5369 failed");