[SERVER-14575] $push operator allows dots in subdocument key names Created: 16/Jul/14  Updated: 29/Jul/14  Resolved: 16/Jul/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.4.10
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alex Parise Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: Windows
Steps To Reproduce:

Introduce this code into an update call:

{
 '$push': {
  'foo3': {
   'test': {
    'blam.0': {
	 'tee': 'haw'
	}
   }
  }
 }
}

Participants:

 Description   

$push operator allows database updates with dots (".") in the keys on subdocuments.

I found this issue when I was coding today in PHP, then reproduced it in MongoVue on a Windows 7 system.

Using $set, I very properly get the following error:
"Error in performing Update
Safemode detected an error 'not okForStorage'. (Response was

{ "err" : "not okForStorage", "code" : 12527, "n" : 0, "connectionId" : 853, "ok" : 1.0 }

).

Using $push, the update succeeds, but later edits (properly) yield the following message:
Error - unable to modify value
Element name 'blam.0' is not valid because it contains a '.'.
Type: MongoDB.Bson.BsonSerializationException



 Comments   
Comment by Scott Hernandez (Inactive) [ 16/Jul/14 ]

This has been fixed in newer versions; please upgrade to 2.6 for better checking and validation with your updates.

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