beanie
beanie copied to clipboard
[BUG]before_event bug
class Sample(Document): num: int name: str version: int = 0
@before_event(Update)
def increase_version(self):
self.version += 1
doc = await Sample.find_one() await doc.inc({Sample.num: 1})
i looked in database num increase so its clearly updated but the versioning is never changing
its because in update it only update with args from the query itself but the action event doesnt it it
Hi @CAPITAINMARVEL , Unfortunately it would be tricky and not explicit enough to add an addition set step to the update query for this case
This issue is stale because it has been open 30 days with no activity.
This issue was closed because it has been stalled for 14 days with no activity.