On 4.0.6, when count is run as the first command in a transaction the error message is:
{'code': 263, 'ok': 0.0, 'codeName': 'OperationNotSupportedInTransaction', 'errmsg': "Cannot run 'count' in a multi-document transaction. Please see http://dochub.mongodb.org/core/transaction-count for a recommended alternative."}
On 4.0.7, when count is run as the first command in a transaction the error message is:
{'code': 263, 'ok': 0.0, 'codeName': 'OperationNotSupportedInTransaction', 'errmsg': 'Command is not supported as the first command in a transaction'}
The new error message makes it seem like count might be supported as the second (or third, etc..) command in a transaction. However, when running count as the second command the error message is again:
{'code': 263, 'ok': 0.0, 'codeName': 'OperationNotSupportedInTransaction', 'errmsg': "Cannot run 'count' in a multi-document transaction. Please see http://dochub.mongodb.org/core/transaction-count for a recommended alternative."}