mongodb - Keyword item in monger vector is converted to string -


using monger, writing document contains vector keyword item collection like

(monger.collection/insert-and-return db                                      "test-coll" {:_id 1 :some-vector [:a-keyword]}) 

which returns expected

{:_id 1, :some-vector [:a-keyword]} 

but if fetch particular document like

(monger.collection/find-map-by-id db "test-coll" 1) 

the keyword has been changed string

{:_id 1, :some-vector ["a-keyword"]} 

is expected behaviour , if why?

this expected behaviour mongo database store doesn't support keywords; json. http://clojuremongodb.info/articles/inserting.html#serialization_of_clojure_data_types_to_dbobject_and_dblist

you have manually convert values keywords using monger.conversion/from-db-object.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -