[SERVER-6651] Command names and options should be case insensitve Created: 30/Jul/12  Updated: 10/Dec/14  Resolved: 02/Apr/13

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

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Scott Hernandez (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Comments   
Comment by Scott Hernandez (Inactive) [ 21/Sep/12 ]

Yes, in general (and for user data) but making the command names and their options (as well as replica set configuration for example) field name comparisons case-insensitive is helpful for the user experience, and to reduce bad things happening.

There are many times when people do something like this:

db.runCommand("serverstatus")
{
	"errmsg" : "no such cmd: serverstatus",
	"bad cmd" : {
		"serverstatus" : 1
	},
	"ok" : 0
}

Or this:

> db.coll.runCommand("findAndModify",{Query:{_id:2}, update:{$set:{updated: new Date()}}}) //Query ignored and no error
{
	"value" : {
		"_id" : "John",
		"Address" : {}
	},
	"lastErrorObject" : {
		"updatedExisting" : true,
		"n" : 1
	},
	"ok" : 1
}

There are more cases I can show of this coming up all over the place.

Comment by Eliot Horowitz (Inactive) [ 30/Jul/12 ]

Case insensitive is dangerous and generally not a great idea.

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