[SERVER-31182] Switch order of checkFieldType calls for find command collection identifier arguments Created: 20/Sep/17  Updated: 30/Oct/23  Resolved: 16/Oct/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.6.0-rc1

Type: Task Priority: Minor - P4
Reporter: Maria van Keulen Assignee: Maria van Keulen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Storage 2017-10-23
Participants:

 Description   

As part of the commit for SERVER-27991, which allows specifying a UUID instead of a collection name as the collection identifier for a find command, we check for both types when examining the collection identifier argument. Presently, if one fails to provide a find command with either a string or a BinData UUID, this results in the following error:

Failed to parse: find: 1.0. 'find' field must be of BSON type binData.

The order of the checkFieldType calls should be switched so the error that gets output when neither a UUID nor a collection name is specified says that BSON type "String" was expected.



 Comments   
Comment by Githook User [ 16/Oct/17 ]

Author:

{'email': 'maria@mongodb.com', 'name': 'Maria van Keulen', 'username': 'mvankeulen94'}

Message: SERVER-31182 Clarify parse error for invalidly typed findCmd arguments
Branch: master
https://github.com/mongodb/mongo/commit/51386591ed96fc3070bdaa2652974dadebeaccaf

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