Support DBObject conversion for all objects that implement clojure.lang.Named, not just keywords

This commit is contained in:
Michael S. Klishin 2012-04-11 20:57:31 +04:00
parent 07d44ddc1f
commit e425bc84ea

View file

@ -23,7 +23,7 @@
(ns monger.conversion
(:import [com.mongodb DBObject BasicDBObject BasicDBList DBCursor]
[clojure.lang IPersistentMap Keyword Ratio]
[clojure.lang IPersistentMap Named Ratio]
[java.util List Map Date]
org.bson.types.ObjectId))
@ -43,8 +43,8 @@
(to-db-object [^Ratio input]
(double input))
Keyword
(to-db-object [^Keyword input] (.getName input))
Named
(to-db-object [^Named input] (.getName input))
IPersistentMap
(to-db-object [^IPersistentMap input]