Skip to content

Instantly share code, notes, and snippets.

@serby
Last active December 15, 2015 15:29
Show Gist options
  • Select an option

  • Save serby/5282479 to your computer and use it in GitHub Desktop.

Select an option

Save serby/5282479 to your computer and use it in GitHub Desktop.
var a =
{ "author" : "Author"
, "state" : "Published"
, "section" : "5158bfc0e5aa20eb5c000001"
, "preTitleHtml" : "<p>PreTitleHtml</p>"
, "longTitle" : "LongTitle"
, "shortTitle" : "ShortTitle"
, "subTitle" : "subTitle"
, "slug" : "articlea"
, "standfirst" : "standFirst"
, "body" : [ ]
, "images" : [ ]
, "crops" : { }
, "pageTitle" : "PageTitle"
, "pageDescription" : "PageDescription"
, "seoKeywords" : "SeoKeywords"
, "social" : [ ]
, "relatedSections" : [ ]
, "liveDate" : ISODate("2012-02-01T00:00:00Z")
, "expiryDate" : ISODate("2015-02-01T00:00:00Z")
, "dateCreated" : ISODate("2013-03-31T22:59:12.543Z")
, "displayDate" : ISODate("2012-02-01T00:00:00Z")
, "archiveDate" : ISODate("2013-10-01T22:59:13.208Z")
, "showDisplayDate" : true
, "tags" : [ ]
, "comments" : true
, "likable" : true
, "type" : "article"
, "subType" : null
, "_textIndex" : [ "longtitl", "shorttitl" ]
, "_id" : ObjectId("5158bfc1e5aa20eb5c000004") }
db.article.find(
{"section":"5158bfc0e5aa20eb5c000001"
, "slug":"articlea"
, "state":"Published"
, "$and":
[
{"$or":
[
{ "liveDate":null}
, { "liveDate": {"$lte":"2013-03-31T22:59:13.229Z"}}
]}
,{"$or":
[{"expiryDate":null},{"expiryDate":{"$gte":"2013-03-31T22:59:13.229Z"}}
]}
]
})
@serby

serby commented Mar 31, 2013

Copy link
Copy Markdown
Author

The string dates would actually be proper dates when via the driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment