[SERVER-4448] findAndModify allows invalid field names on update but not insert Created: 07/Dec/11  Updated: 07/Mar/14  Resolved: 27/Jul/13

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.0.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Tony Hannan Assignee: Scott Hernandez (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-7557 Update doesn't support "$"s in the fi... Closed
Operating System: ALL
Participants:

 Description   

> db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te$t" : true }}}, "upsert": true, "new": true});
Tue Dec 06 19:08:10 uncaught exception: findAndModifyFailed failed: "not okForStorage"
> db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te.t" : true }}}, "upsert": true, "new": true});
Tue Dec 06 19:08:15 uncaught exception: findAndModifyFailed failed: "not okForStorage"
> db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "test" : true }}}, "upsert": true, "new": true});
{ "_id" : 1, "test" : { "test" : true } }
> db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te$t" : true }}}, "upsert": true, "new": true});
{ "_id" : 1, "test" : { "te$t" : true } }
> db.test.findAndModify({"query": {"_id":1}, "update": {$set: {"test" : { "te.t" : true }}}, "upsert": true, "new": true});
{ "_id" : 1, "test" : { "te.t" : true } }



 Comments   
Comment by Scott Hernandez (Inactive) [ 27/Jul/13 ]

Dup of SERVER-7557

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