|
Looking at the 3 uses of the string "no such cmd"
1) in copyDatabase we check if the server's error message contains "no such cmd: saslStart" to return a better error message in the case that the server doesn't support SCRAM. We don't need to make changes here, because only an old server (with the old way of sending error messages) would ever trigger this code path. Also note that the code is correct even if this comparison fails, since then we would just throw an OperationException.
2) in enumerateCollections we check "no such cmd" to see if we are talking to an old server that doesn't support listCollections. We are OK here because we also check if the error code is 59 (CommandNotFound) first.
3) In enumerateIndexes, same as (2) we also check error code 59.
|