Usage
(q (= :bedrooms 1)
(= :country.code "GR")
(group {:_id :stars}
{:average-price (avg :price)})
(sort :average-price)
(limit 1))
Generates
aggregate(
[{"$match":
{"$expr":
{"$and":
[{"$eq": ["$bedrooms", 1]},
{"$eq": ["$country.code", "GR"]}]}}},
{"$group": {"_id": "$stars",
"average-price": {"$avg": "$price"}}},
{"$sort": {"average-price": 1}},
{"$limit": 1}])
cMQL example apps
Java or Clojure programmers use cmql-j
[org.cmql/cmql-core "0.2.0-SNAPSHOT"]
[org.cmql/cmql-j "0.2.0-SNAPSHOT"]
JS or Clojurescript programmers use cmql-js
[org.cmql/cmql-core "0.2.0-SNAPSHOT"]
[org.cmql/cmql-js "0.2.0-SNAPSHOT"]
Copyright © 2020,2022 Takis Karyadis.
Distributed under the Eclipse Public License version 1.0.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close