>>> import pymongo_inmemory
>>> client = pymongo_inmemory.MongoClient("mongodb://127.0.0.1/test")
{"t":{"$date":"2023-09-28T10:08:22.707Z"},"s":"I", "c":"CONTROL", "id":5324701, "ctx":"-","msg":"Test storage engine does not support enableMajorityReadConcern=true, forcibly setting to false","attr":{"storageEngine":"ephemeralForTest"}}
{"t":{"$date":"2023-09-28T10:08:22.709Z"},"s":"W", "c":"CONTROL", "id":4788401, "ctx":"-","msg":"Lock-free reads is not compatible with enableMajorityReadConcern=false: disabling lock-free reads."}
>>> client._MongoClient__default_database_name
>>> client.get_default_database()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../site-packages/pymongo/mongo_client.py", line 2247, in get_default_database
raise ConfigurationError("No default database name defined or provided.")
pymongo.errors.ConfigurationError: No default database name defined or provided.
>>>
Expected behavior
The database name from the connection strings should be kept.
Describe the bug To Reproduce
Expected behavior The database name from the connection strings should be kept.
Logs
Probably this happens because the
host
argument is not sent topymongo.MongoClient
's constructor.Screenshots
Context: