Allow object-id to convert string to object-id

This commit is contained in:
Robin Heggelund Hansen 2014-08-07 01:23:30 +02:00
parent 0312ecd2f6
commit 00dad8d0fb

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"))