Object ID :

Javascript functions
	var objectIdFromDate = function (date) {
	    return Math.floor(date.getTime() / 1000).toString(16) + "0000000000000000";
	};
	
	var dateFromObjectId = function (objectId) {
	    return new Date(parseInt(objectId.substring(0, 8), 16) * 1000);
	};
	            
Java
	DateTime minDate = new DateTime().minusDays(2);
	Long timestamp = minDate.getMillis() / 1000L;
	String oidString = Long.toHexString(timestamp) + "0000000000000000";
	            
	ObjectId id = new ObjectId(oidString);
	DBObject query = new BasicDBObject("_id", new BasicDBObject("$gt", id));
	            
출처 URL
http://steveridout.github.io/mongo-object-time/
https://coderwall.com/p/jv-y9q/converting-a-date-to-a-mongo-objectid