Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $subset = $db->col->find(
- array(
- 'timestamps'=> array(
- '$elemMatch'=> array(
- '$gte'=> new MongoDate(strtotime('2016-05-25 13:00:00')),
- '$lte'=> new MongoDate(strtotime('2016-05-25 14:00:00'))
- )
- )
- )
- );
- {
- "month": {
- "$date": 1464134400000
- },
- "timestamps": [
- {
- "$date": 1464181803000
- },
- {
- "$date": 1464182103000
- },
- {
- "$date": 1464182403000
- },
- {
- "$date": 1464183003000
- },
- {
- "$date": 1464183603000
- },
- {
- "$date": 1464184203000
- },
- {
- "$date": 1464184803000
- },
- {
- "$date": 1464185403000
- },
- {
- "$date": 1464186003000
- }
- ],
- "status_history": [
- 1,
- 1,
- 1,
- 0,
- 1,
- 1,
- 1,
- 0,
- 1
- ],
- "_id": 12345
- }
- db.Collection.find({
- created_at : {
- '$gte': new Timestamp(new Date(2012, 0, 21), 0),
- '$lte': new Timestamp(new Date(2012, 0, 22), 0)
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement