[SERVER-25453] dbhash command return misleading error when passing collection name Created: 05/Aug/16  Updated: 06/Dec/22  Resolved: 06/Dec/16

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

Type: Bug Priority: Minor - P4
Reporter: Steven Hand Assignee: Backlog - Storage Execution Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Operating System: ALL
Participants:

 Description   

The dbhash command returns a misleading error when running an old form of the command:

// run dbHash using the old way
> db.runCommand( { dbHash : 'config' } )
{ "ok" : 0, "errmsg" : "need a valid database name", "code" : 28539 }
// but, thisis case, the "config" database exists and is valid
> show dbs
config         0.023GB
// run with the new way with now problem
> db.runCommand( { dbHash : 1, collections: ['config'] } )
{
	"host" : "Stevens-MacBook-Pro-2.local",
	"collections" : {
		
	},
	"md5" : "d41d8cd98f00b204e9800998ecf8427e",
	"timeMillis" : 0,
	"fromCache" : [ ],
	"ok" : 1
}



 Comments   
Comment by Eric Milkie [ 06/Dec/16 ]

The documentation states that the "dbHash" parameter can have any value, and has no other meaning. The only way to provide the names of the databases to hash is via the "collections" parameter. I checked the docs back to version 3.0 and they all agree.
Therefore, I don't see anything further to do here.

Generated at Thu Feb 08 04:09:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.