Re: How to insert Date String as date in MongoDB

2016-03-15 Thread gramanero
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 t

Re: How to insert Date String as date in MongoDB

2016-03-15 Thread gramanero
Thanks for confirming. I tested the logic and while there are no errors, the value of the /time /property is being persisted as /null /in Mongo. I am going to take a look at the converter classes to see if I can figure out how that is possible. Any thoughts? Again, thanks for the help on this!

Re: How to insert Date String as date in MongoDB

2016-03-14 Thread Raul Kripalani
Yeah. Converting the body to a String is a good way to guarantee that the conversion logic we're interested in will kick in. Just for reference, have a look at the MongoDbConverters class. Cheers, Raúl. On 14 Mar 2016 18:52, "gramanero" wrote: > Yes I can try that. To make sure I am on the same

Re: How to insert Date String as date in MongoDB

2016-03-14 Thread gramanero
Yes I can try that. To make sure I am on the same page is this what you are asking for? *Route:* / / *JSON to send:* /{ "time" : { "$date" : "2016-02-19T17:37:57.673+" } }/ Or do think we should not perform the convertBodyTo string? Thank you for the quick response! I seriously appre

Re: How to insert Date String as date in MongoDB

2016-03-14 Thread Raul Kripalani
Jackson is not MongoDB-specific and therefore doesn't recognise $date types. The camel-mongodb component uses MongoDB's JSON class to parse Strings, which does recognise Mongo-specific types: http://api.mongodb.org/java/2.6.5/com/mongodb/util/JSON.html. Can you try sending the JSON string directl

Re: How to insert Date String as date in MongoDB

2016-03-14 Thread gramanero
Any thoughts on my last post as to how we can use ISODates with camel-mongo? Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5779035.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to insert Date String as date in MongoDB

2016-03-04 Thread gramanero
Thank you for the response and information. I believe I tried what is recommended in the link that you provided. Below is a copy from the Logs via the Karaf console. I hope the formatting is not too terrible. I can try and provide it another way if necessary. Pretty much the same result as I was s

Re: How to insert Date String as date in MongoDB

2016-03-03 Thread Raul Kripalani
MongoDB uses a special representation of JSON they call BSON. According to their docs, timestamps should be represented with the $timestamp token, along with 't' and 'i' portions for them to be interpreted correctly by the drivers: https://docs.mongodb.org/manual/reference/mongodb-extended-json/#t

Re: How to insert Date String as date in MongoDB

2016-03-03 Thread gramanero
I would be interested in knowing the answer on how to do this as well. I posted in a different thread and the datatype I am trying to do this with is the ISODate built-in mongo type. I am using Spring DSL as well. Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/How-to

Re: How to insert Date String as date in MongoDB

2016-02-29 Thread yogu13
Apologies for delayed response! can u try having it as Date instead of String? Regards, -Yogesh -- View this message in context: http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5778457.html Sent from the Camel - Users mailing list archive at Nabble.com

Re: How to insert Date String as date in MongoDB

2016-02-28 Thread Royamit
It is of type string -- View this message in context: http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5778407.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to insert Date String as date in MongoDB

2016-02-27 Thread yogu13
Hi, What datatype is CreatedDateTimeUTC after it is converted using .convertBodyTo(DBObject.class) Regards, -Yogesh -- View this message in context: http://camel.465427.n5.nabble.com/How-to-insert-Date-String-as-date-in-MongoDB-tp5778310p5778385.html Sent from the Camel - Users mailing list