Eliminate this reflection warning

Unfortunately, because Java driver's return type is so generic (Iterable),
we have to do it by type hinting what is really returned as the result set
(by inspecting the Java driver code paths).
This commit is contained in:
Michael S. Klishin 2012-06-09 00:33:55 +04:00
parent e008e0d18d
commit 5813f61649

View file

@ -282,7 +282,9 @@
MapReduceOutput
(count [^MapReduceOutput this]
(.count ^Iterable (.results this))))
;; MongoDB Java driver could use a lot more specific type than Iterable but
;; it always uses DBCollection#find to popular result set. MK.
(.count ^DBCursor (.results this))))
(defn ^DBObject get-last-error
"Returns the the error (if there is one) from the previous operation on this connection.