Hi,
First of all - clj-json.core/parse-string (which I assume is referenced as json/parse-string) returns map with strings (not keywords) as keys:
user=> (clj-json.core/parse-string "{\"post-date\":{\"$gt\":\"2012-08-28T00:00:00Z\"}}")
{"post-date" {"$gt" "2012-08-28T00:00:00Z"}}
In such simple case, you can remedy that using e.g. clojure.walk/keywordize-keys:
user=> (clojure.walk/keywordize-keys (clj-json.core/parse-string "{\"post-date\":{\"$gt\":\"2012-08-28T00:00:00Z\"}}"))
{:post-date {:$gt "2012-08-28T00:00:00Z"}}
Other thing is that you have to supply java.util.Date object to operate on dates in congomongo, for example:
(somnium.congomongo/fetch :coll :where {:post-date {:$lte (java.util.Date.)}})
To parse a date from string, you could use for example java.text.SimpleDateFormat or Joda Time library and use clojure.walk functions to
walk the tree parsing any date values based on a regexp or key name.
Anyway such parsing kind of breaks the magic behind passing query as JSON from some external code. Storing date as string should solve this
particular issue, but would be very inelegant.
--