-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Query Execution
-
(copied to CRM)
Empty string field names are allowed in json, and they are currently allowed in mongo documents. However there are many places in mongo code where empty string field names are not supported correctly, often because the empty string is used as an internal sentinel value in the implementation of various features.
In addition to the linked cases, here are some others:
Projection of an empty string field has opposite of desired effect:
> c = db.c; test.c > c.drop(); true > c.save( { '':'foo' } ); > c.find( {}, { '':0 } ); { "_id" : ObjectId("5037e1fd4764d2aca5d2cc35"), "" : "foo" } > c.find( {}, { '':1 } ); { "_id" : ObjectId("5037e1fd4764d2aca5d2cc35") }
FieldPath doesn't allow empty string field names (SERVER-6592), I think there are a number of cases where the aggregation framework won't handle them.
Once we decide what to do about empty string fields we should do an audit to ensure we correctly implement the desired behavior.
- is depended on by
-
SERVER-5944 modifier failure with empty string field name and nested fields
- Closed
- is duplicated by
-
SERVER-3874 Sort and create index don't work for empty string field name
- Closed
-
SERVER-12996 Able to insert and upsert documents with empty field name
- Closed
-
SERVER-13138 Possible to create documents with empty field names
- Closed
-
SERVER-9693 Impossible to select a subdocument with blank field name ( "" )
- Closed
-
SERVER-19740 Reject documents and queries with empty field names
- Closed
- is related to
-
SERVER-15516 2.6.x secondaries cannot apply update performed by 2.4.x primary, fassert
- Closed
-
SERVER-19725 NULL pointer crash in QueryPlanner::plan with $near operator
- Closed
-
COMPASS-4414 Import via CSV creates fields with empty field name
- Closed
-
SERVER-6999 Embedded "dot-notation" fields broken for tag based balancing
- Closed
-
SERVER-2051 Disallow empty string keys
- Open
- related to
-
SERVER-7174 Implement all update() operators
- Closed
-
SERVER-11812 Can create indexes on invalid fields (empty, $** component)
- Closed