diff --git a/aredis_om/model/model.py b/aredis_om/model/model.py index e3533294..d4e63da9 100644 --- a/aredis_om/model/model.py +++ b/aredis_om/model/model.py @@ -1291,6 +1291,8 @@ async def save(self, pipeline: Optional[Pipeline] = None) -> "HashModel": db = pipeline document = jsonable_encoder(self.dict()) # TODO: Wrap any Redis response errors in a custom exception? + # store null values as string zero: "0" + document = {key: val if val else "0" for key, val in document.items()} await db.hset(self.key(), mapping=document) return self