Liking cljdoc? Tell your friends :D

cMQL

  • query and data processing language for MongoDB
  • up to 3x less code
  • simple structure
  • simple notation

Usage

  • as tool to generate MQL usable from all drivers
  • to call cMQL code directly from Java/NodeJS/Clojure/Clojurescript

Getting Started

Example

(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 projects

cMQL example apps

Leiningen dependencies

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"]

License

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