You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guys, I can't find a relevant info for that from docs.
how to set the storage engine to 'flat-file' in BSON format ?
and this one raise exception.
frommontydbimportset_storage, MontyClientset_storage("default.db", use_bson=True) # optional stepclient=MontyClient("default.db") # use current working dir if no path given# >>> from montydb import MontyClientcol=client.db.testcol.insert_many([{"stock": "A", "qty": 6}, {"stock": "A", "qty": 2}])
cur=col.find({"stock": "A", "qty": {"$gt": 4}})
print(list(cur))
➜ montydb-demo .venv/bin/python main.py
Traceback (most recent call last):
File "/Users/jackywu/Repository/demo/montydb-demo/main.py", line 5, in <module>
client = MontyClient("default.db") # use current working dir if no path given
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/montydb/client.py", line 41, in __init__
storage_cls = provide_storage(repository)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/montydb/configure.py", line 269, in provide_storage
_bson_init(_session["use_bson"])
File "/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/montydb/configure.py", line 279, in _bson_init
bson.init(use_bson)
File "/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/montydb/types/bson.py", line 67, in init
from ._bson import BSON_
File "/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/montydb/types/_bson.py", line 5, in <module>
class BSON_(types.ModuleType):
File "/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/montydb/types/_bson.py", line 7, in BSON_
from bson import (
ImportError: cannot import name 'SON' from 'bson' (/Users/jackywu/Repository/demo/montydb-demo/.venv/lib/python3.12/site-packages/bson/__init__.py)
``
besides, can I set a user and password to protect the connection to the local falt-file db file?
The text was updated successfully, but these errors were encountered:
I guys, I can't find a relevant info for that from docs.
how to set the storage engine to 'flat-file' in BSON format ?
and this one raise exception.
The text was updated successfully, but these errors were encountered: