Merge pull request #86 from Skinney/object-id-str

Allow object-id to convert string to object-id
This commit is contained in:
Michael Klishin 2014-08-07 05:57:04 +04:00
commit ea158554fc

View file

@ -30,9 +30,11 @@
(.toString (new BigInteger n (SecureRandom.)) num-base))
(defn ^ObjectId object-id
"Returns a new BSON object id"
[]
(ObjectId.))
"Returns a new BSON object id, or converts str to BSON object id"
([]
(ObjectId.))
([s]
(ObjectId. s)))
(defprotocol GetDocumentId
(get-id [input] "Returns document id"))