5 var x = db.groups.aggregate({
10 if: { $eq: ['$sd.type', null] },
24 printjson(x.toArray());
29 var twoMonths = Date.now() - 86400000 * 30;
31 function createIdForTimestampString(timestamp) {
32 var hexSeconds = Math.floor(timestamp/1000).toString(16);
34 while(hexSeconds.length < 8) {
35 hexSeconds = "0" + hexSeconds;
37 return ObjectId(hexSeconds + "0000000000000000");
41 var y = db.groups.aggregate({
43 _id: { $gt: createIdForTimestampString(twoMonths) }
50 if: { $eq: ['$sd.type', null] },
63 printjson(y.toArray());