[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:
Related
related to SERVER-24174 Inconsistent rule for storing dotted ... Closed
related to SERVER-29334 Cannot write shard chunks documents w... Closed
related to SERVER-3943 $quote operator Closed
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.

Generated at Thu Feb 08 03:23:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.