[SERVER-10454] Do not store field names with "." in any metadata collections Created: 07/Aug/13 Updated: 06/Dec/22 Resolved: 23/May/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding, Tools |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Done | Votes: | 0 |
| Labels: | PM497 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Sharding
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
If you shard a collection with a key like {{ {"a.b":1}}} the system stores that as a field name in various collections (collections, chunks, changelog and tags to name a few). This causes problems with backing up and restoring data or moving data to other databases (since these fields are invalid as user documents). It also means that the clients/driver and server has to special case these collections (or database) to disable regular validation (hence the problem moving this data to user collections). This is somewhat related to trying to copy the profiler documents (which have fields with $prefix or dots) to different collections. |
| Comments |
| Comment by Andy Schwerin [ 23/May/17 ] |
|
After consultation with david.storch, I don't believe it should be illegal to store fieldsnames containing dots. It just happens to be impossible to construct path expressions over them, which means you cannot index over them or query over them directly. Extensions to the query language could be added to allow for that, if it were desired. In the meantime, they seem safe to store. |