Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9412

is there difference connect with mongos and single instance?

    XMLWordPrintable

Details

    • Question
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      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!

      Attachments

        Activity

          People

            stephen.steneker@mongodb.com Stennie Steneker
            auto auto
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: