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.
14 lines
333 B
JavaScript
14 lines
333 B
JavaScript
// https://jira.mongodb.org/browse/SERVER-5369
|
|
// correctly sort dates before 1970
|
|
|
|
// use the aggregation test db
|
|
db = db.getSiblingDB('aggdb');
|
|
|
|
db.test.drop();
|
|
db.test.insert({d:ISODate('1950-01-01')})
|
|
db.test.insert({d:ISODate('1980-01-01')})
|
|
|
|
var out = db.test.aggregate({$sort:{d:1}}).toArray();
|
|
|
|
assert.lt(out[0].d, out[1].d)
|