operator docs
This commit is contained in:
parent
5512590e96
commit
f3aadc7670
2 changed files with 16 additions and 1 deletions
15
README.md
15
README.md
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue