diff options
Diffstat (limited to 'jstests/core/update_currentdate_examples.js')
-rw-r--r-- | jstests/core/update_currentdate_examples.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/jstests/core/update_currentdate_examples.js b/jstests/core/update_currentdate_examples.js index f6270c62871..3430c261481 100644 --- a/jstests/core/update_currentdate_examples.js +++ b/jstests/core/update_currentdate_examples.js @@ -4,22 +4,22 @@ var coll = db.update_currentdate; coll.drop(); // $currentDate default -coll.remove({}) +coll.remove({}); coll.save({_id:1, a:2}); -res = coll.update({}, {$currentDate: {a: true}}) +res = coll.update({}, {$currentDate: {a: true}}); assert.writeOK(res); -assert(coll.findOne().a.constructor == Date) +assert(coll.findOne().a.constructor == Date); // $currentDate type = date -coll.remove({}) +coll.remove({}); coll.save({_id:1, a:2}); -res = coll.update({}, {$currentDate: {a: {$type: "date"}}}) +res = coll.update({}, {$currentDate: {a: {$type: "date"}}}); assert.writeOK(res); -assert(coll.findOne().a.constructor == Date) +assert(coll.findOne().a.constructor == Date); // $currentDate type = timestamp -coll.remove({}) +coll.remove({}); coll.save({_id:1, a:2}); -res = coll.update({}, {$currentDate: {a: {$type: "timestamp"}}}) +res = coll.update({}, {$currentDate: {a: {$type: "timestamp"}}}); assert.writeOK(res); -assert(coll.findOne().a.constructor == Timestamp) +assert(coll.findOne().a.constructor == Timestamp); |