I tried to use the queryable encryption function of MongoDB according to the official documents(Quick Start of Queryable Encryption), and copied the Complete Python Application example to run on my local computer.However, an error occurred during the compilation of the make_data_key.py.
The error message is as follows:
Traceback (most recent call last):
File "D:\Python\project\MongoDBtest\make_data_key.py", line 119, in <module>
encrypted_db.create_collection(encrypted_coll_name)
File "D:\Python\Python\lib\site-packages\pymongo\_csot.py", line 105, in csot_wrapper
return func(self, *args, **kwargs)
File "D:\Python\Python\lib\site-packages\pymongo\database.py", line 448, in create_collection
return Collection(
File "D:\Python\Python\lib\site-packages\pymongo\collection.py", line 232, in __init__
self.__create(name, kwargs, collation, session, encrypted_fields=encrypted_fields)
File "D:\Python\Python\lib\site-packages\pymongo\collection.py", line 313, in __create
self._command(
File "D:\Python\Python\lib\site-packages\pymongo\collection.py", line 285, in _command
return sock_info.command(
File "D:\Python\Python\lib\site-packages\pymongo\pool.py", line 766, in command
return command(
File "D:\Python\Python\lib\site-packages\pymongo\network.py", line 166, in command
helpers._check_command_response(
File "D:\Python\Python\lib\site-packages\pymongo\helpers.py", line 181, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: **Encrypted collections are not supported on standalone**, full error: {'ok': 0.0, 'errmsg': 'Encrypted collections are not supported on standalone', 'code': 6346402, 'codeName': 'Location6346402'}
I wonder how to solve it.