This is preparatory work for supporting external sort for the find command (
SERVER-7694). Further work will be required for the allowDiskUse option to actually take effect. This ticket just tracks the work necessary to parse the option and set it on QueryRequest, and then to plumb the resulting boolean flag down to SortStage.
The allowDiskUse flag is optional, and must be a boolean if present. If not present, it defaults to false. These behaviors should be identical to the allowDiskUse flag accepted by the aggregate command.
Since allowDiskUse:true won't actually do anything until further engineering work is completed, the find command should fail if allowDiskUse:true is specified and enableTestCommands is false. This ensures that users cannot access the feature until it is fully implemented. This restriction will be lifted once
SERVER-7694 is implemented.
We will also need to add a shell helper for setting the allowDiskUse flag. That work can be split off into a separate ticket if it doesn't fit naturally here.