Browse Source

Adds query to find all in a mongodb collection

cserri-tw 2 years ago
parent
commit
8e5ceb1b1e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      database-clojureapp/README.md

+ 8 - 1
database-clojureapp/README.md

@@ -167,11 +167,18 @@ user=> (let [conn (mg/connect {:port 27017})
167 167
 Find one as clojure map
168 168
 ```aidl
169 169
 user=> (let [conn (mg/connect {:port 27017})
170
-      db (mg/get-db conn "users")
170
+      db (mg/get-db conn "decode")
171 171
       data (mc/find-one-as-map db "users" {:email "admin@email.com"})]
172 172
       (println data))
173 173
 ```
174 174
 
175
+Find all as clojure map
176
+```aidl
177
+(let [conn (mg/connect {:port 27017})
178
+   db (mg/get-db conn "decode")]
179
+   (mc/find-maps db "petitions"))
180
+```
181
+
175 182
 ### Docs
176 183
 
177 184
 - [Monger](http://clojuremongodb.info/articles/connecting.html)