-
Type: Question
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Environment:
*Location*: http://docs.mongodb.org/manual/reference/mongos/
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1478.0 Safari/537.36
*Referrer*: https://www.google.com/
*Screen Resolution*: 1280 x 800
*repo*: docs
*source*: reference/mongos
*Location*: http://docs.mongodb.org/manual/reference/mongos/ *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1478.0 Safari/537.36 *Referrer*: https://www.google.com/ *Screen Resolution*: 1280 x 800 *repo*: docs *source*: reference/mongos
I use mongo dervier's clojure wrapper to connect to mongos,
(defn get-conn []
(let [conn (make-connection (:database db-config)
:host (:host db-config)
:port (:port db-config)
)]
(auth conn)
conn))
try to connect to mongos, but when query something:
(with-mongo conn
(apply fetch (concat '(:collection) args))))
always has exception:
java.lang.NullPointerException
at com.mongodb.DBCursor._check(DBCursor.java:365)
at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
at com.mongodb.DBCursor.hasNext(DBCursor.java:484)
at clojure.lang.IteratorSeq.create(IteratorSeq.java:27)
at clojure.lang.RT.seqFrom(RT.java:495)
at clojure.lang.RT.seq(RT.java:486)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__4215.invoke(core.clj:2479)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
But if I use query like fetch-one, count, it works,
this code works for other single instance mongo.
what should I do?
Thanks!