I did a little more playing around. Discovered and verified a few different
things. First, I recall reading somewhere that the type mapping is being
cached (I think I read that). So when I played around with the JSON payload
being sent in I started to get mixed results and what was previously not
throwing any errors was now throwing a conversion error. I reloaded the
bundle, went back to the JSON that we agreed upon, and no more errors. So I
suspect that caching of the type conversion is happening somewhere (just a
hunch based on my observations though).

More importantly, when I changed the JSON to this:

/{ "time" : { "$date" : "2016-02-19T17:37:57.673Z" } }/

replacing the /+0000/ offset with /Z/, the document actually persisted
correctly as a DateTime type. Very cool. Now I need to figure out how to
manipulate the JSON in Spring DSL from /ISODate(...)/ (which is how the
callers will be sending the payload in to the route) to /{ "$date" : "...Z"
}/ so that I can put this piece to rest.

Does any of that make sense to you?




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5779103.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to