Does the exact same code work connecting directly to a single instance
or a to a replica set (instead of mongos shard server)?

On Fri, Apr 19, 2013 at 7:17 AM, Zhi Yang <[email protected]> wrote:
> I use
> (defn get-conn []
>   (let [conn (make-connection (:database db-config)
>                               :host (:host db-config)
>                               :port (:port db-config)
>                               (mongo-options :auto-connect-retry true))]
>     (auth conn)
>     conn))
> try to connect to mongos, but
>
> (with-mongo conn
>     (apply fetch (concat '(:collection) args))))
>
> always has exception, any one know why?
>
> 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)
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to