operator docs

This commit is contained in:
George Narroway 2019-11-22 13:49:46 +08:00
parent 5512590e96
commit f3aadc7670
2 changed files with 16 additions and 1 deletions

View file

@ -120,6 +120,21 @@ options will be applied on top of this object.
Again, read the [docs](https://cljdoc.org/d/mongo-driver-3/mongo-driver-3/CURRENT/api/mongo-driver-3.collection)
for full API documentation.
### Using operators
Many mongo queries take operators like `$eq` and `$gt`. These are exposed in the `mongo-driver-3.operator` namespace.
``` clojure
(ns my.app
(:require [mongo-driver-3.collection :as mc]
[mongo-driver-3.operator :refer [$gt]))
(mc/find db "test" {:a {$gt 3}})
;; This is equivalent to, but with less chance of error than:
(mc/find db "test" {:a {:$gt 3}})
```
## License
Released under the MIT License: http://www.opensource.org/licenses/mit-license.php

View file

@ -1,4 +1,4 @@
(defproject mongo-driver-3 "0.4.0"
(defproject mongo-driver-3 "0.5.0-SNAPSHOT"
:description "A Clojure wrapper for the Java MongoDB driver 3.11+."
:url "https://github.com/gnarroway/mongo-driver-3"
:license {:name "The MIT License"