0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/aggregation/bugs/server9289.js

11 lines
322 B
JavaScript

// server9289 - support objects as single arguments to expressions.
var t = db.server9289;
t.drop();
t.insert({date: ISODate('2013-08-14T21:41:43Z')});
// This would result in a parse error on older servers
assert.eq(t.aggregate({$project: {year: {$year: {$add: ['$date', 1000]}}}}).toArray()[0].year,
2013);