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