Priority: Major - P3
Resolution: Won't Fix
Affects Version/s: None
Fix Version/s: None
There are multiple ways to store a nested document in mongodb with dot in field names.
- Serialize the whole document as a string and store it.
- Since MongoDB have restrictions on only top level fields containing dot, we can wrap the entire document in another document whose only field name doesn't have a dot. While returning data, we can always query internal document of interest and return it.
But the important abilities we might loose are querying and patching of nested fields.
To be able to retain these two, we might have to replace dot character with some decent character sequence and persist it. Today, there is no easy way to specify a replacement for dot in codecs.
For e.g. Spring data for mongodb provides an easy way to do this:
It would be good to provide an easy knob to set replacement for special characters(dot and dollar to start with) and all the codecs should replace those special characters in the property names.