[SERVER-12007] add support for new ObjectId(Date|Number) Created: 09/Dec/13  Updated: 09/Sep/14  Resolved: 06/Jun/14

Status: Closed
Project: Core Server
Component/s: Admin, Shell
Affects Version/s: None
Fix Version/s: 2.7.2

Type: Improvement Priority: Major - P3
Reporter: Yorkie Neil Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-14623 ObjectId.fromDate is not correct for ... Closed
Participants:

 Description   

see https://github.com/marcello3d/node-buffalo/pull/11, please.
Then could u check the following shell scripts:

var timespan = Date.now() - 10*60*60*1000;
db.myColl.find({_id: {'$gt': timespan}}).count();

I would get the latest 10 hours records from their insertion date, It's useful.



 Comments   
Comment by Githook User [ 06/Jun/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12007 add shell helper to create ObjectId from Date
Branch: master
https://github.com/mongodb/mongo/commit/bf7eda1de3d01005ec61e1414428514b370f93cb

Comment by Yorkie Neil [ 06/Jun/14 ]

hi, @Benety, thanks for your reply, but what i excepted is a more convenient way to mongo shell should be bumped in this issue

Comment by Benety Goh [ 05/Jun/14 ]

There is a JavaScript-only solution (no need to modify v8_db.cpp):

http://stackoverflow.com/questions/8749971/can-i-query-mongodb-objectid-by-date

Generated at Thu Feb 08 03:27:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.