[SERVER-12913] Improve update error message for storage validation Created: 26/Feb/14  Updated: 11/Jul/16  Resolved: 12/Mar/14

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc2

Type: Improvement Priority: Minor - P4
Reporter: Andreas Nilsson Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: 26qa, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Participants:

 Description   

1. Slightly off error message:

{
	"query" : {	},
	"update" : {
		"$set" : {
			"$foo" : 1
		}
	},
	"err" : "$foo is not valid for storage."
}
{
	"query" : {},
	"update" : {
		"$set" : {"a.$foo" : 2}
	},
	"err" : "$foo is not valid for storage."

Suggest change to
"DollarPrefixedFieldName: $foo is not a valid field name"
I would prefer "a.$foo" instead of "$foo" in the second example.



 Comments   
Comment by Githook User [ 12/Mar/14 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-12913: improve storage validation messages
Branch: master
https://github.com/mongodb/mongo/commit/b0c31161d9fc58a18eaff398b48423b724b96a0e

Comment by Scott Hernandez (Inactive) [ 06/Mar/14 ]

Now produces this:

> db.a.update({_id:1}, {$set:{a:{"$foo":1}}}, {upsert:true})
...		"code" : 52,
		"errmsg" : "The dollar ($) prefixed field '$foo' in 'a.$foo' is not valid for storage."
> db.a.update({_id:1}, {$set:{a:{"x.foo":1}}}, {upsert:true})
...		"code" : 57,
		"errmsg" : "The dotted field 'x.foo' in 'a.x.foo' is not valid for storage."

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