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
Describe the bug
Document.save() fails when using a timeseries collection, returning pymongo.errors.OperationFailure: Taking test.timeseries_test lock for timeseries is not allowed, full error:
{'ok': 0.0, 'errmsg': 'Taking test.timeseries_test lock for timeseries is not allowed', 'code': 166, 'codeName': 'CommandNotSupportedOnView'}
To Reproduce
with beanie==1.26.0, pymongo==4.8.0, and motor==3.5.1 on python 3.11.5
For using a time series collection, I wasn't able to find one, however for my specific use-case, just a regular collection with a TTL index fit my needs, although it's less efficient.
You must not use the save method as it passes upsert=True to the underlying pymongo function which is not supported (see here). Instead use insert. I think this should be added in the docs related to time series
Describe the bug
Document.save() fails when using a timeseries collection, returning pymongo.errors.OperationFailure: Taking test.timeseries_test lock for timeseries is not allowed, full error:
To Reproduce
with beanie==1.26.0, pymongo==4.8.0, and motor==3.5.1 on python 3.11.5
Expected behavior
Document is successfully inserted
Additional context
The code above does successfully insert when not using a timeseries collection
The text was updated successfully, but these errors were encountered: