Skip to content

Instantly share code, notes, and snippets.

@monyskynet
Created July 26, 2013 01:58
Show Gist options
  • Save monyskynet/6085455 to your computer and use it in GitHub Desktop.
Save monyskynet/6085455 to your computer and use it in GitHub Desktop.
Date Range, storing seperate date compnent
{$and:[{SiteId:ObjectId('516f33ab317fa76d0839b3d3')},{Year:2013,Month:1,Day:{$gte:1,$lte:10}}]} {$and:[{SiteId:ObjectId('516f33ab317fa76d0839b3d3')},{'Year':2013},{$or:[{Month:1,Day:{$gte:30}},{Month:2},{Month:3,Day:{$lte:10}}]}]} {$and:[ {SiteId:ObjectId('516f33ab317fa76d0839b3d3')}, {$or:[ {Year:2011,Month:10,Day:{$gte:30}}, {Year:2011,Month:{$gt:10}}, {Year:{$gt:2011,$lt:2013}}, {Year:2013,Month:{$lt:1}}, {Year:2013,Month:1,Day:{$lte:10}} ]} ]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment