Hi Mark, Correct. Mongo doesn't accept dot characters in field naming because it serves as a separator for nested fields, so it's reserved.
It seems like a great idea. Please feel free to create a JIRA. Would you be happy to work on a patch? If you want I can provide you with some guidance since I know this component inside out because I created it ;) There are a number of type converters that MongoDB provides... What's the original payload type before it hits the MongoDB endpoint? (Object, HashMap, etc.). I assume it's an Object but please confirm. Thanks, -- *Raúl Kripalani* Apache Camel Committer Enterprise Architect, Program Manager, Open Source Integration specialist http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk> On Tue, Oct 2, 2012 at 4:22 PM, Mark Doyle <markjohndo...@gmail.com> wrote: > I have a problem where a String field contains a period. This causes the > following exception: > > Caused by: java.lang.IllegalArgumentException: fields stored in the db > can't have . in them. (Bad Key: 'Stock6.tm.Azimuth') > > which I believe stems from restrictions in the depths of the mongo! > > The solution seems to be to convert the character to something else (e.g. a > comma) before inserting and back again after finding. Does this seem like > something the camel-mongo component should offer as an option, or even > silently deal with by default? Could it be a change in the type converters? > I think that uses Jackson to build the DB object and therefore could filter > out and replace periods. I suppose a user could run into problems if they > overrode the converters with their own. > > I don't know how camel works under the covers so this might not work, > especially if the converters aren't used to create a real object from > the DBObject returned by Mongo. >