Skip to content

Commit

Permalink
Database: Update index usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsedla1o committed Jul 12, 2024
1 parent 90e7e90 commit 4d7f4a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dp3/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def delete_old_dps(self, etype: str, attr_name: str, t_old: datetime) -> None:
master_col = self._master_col_name(etype)
try:
self._db[master_col].update_many(
{attr_name: {"$exists": True}}, {"$pull": {attr_name: {"t2": {"$lt": t_old}}}}
{f"{attr_name}.t2": {"$lt": t_old}}, {"$pull": {attr_name: {"t2": {"$lt": t_old}}}}
)
except Exception as e:
raise DatabaseError(f"Delete of old datapoints failed: {e}") from e
Expand Down

0 comments on commit 4d7f4a2

Please sign in to comment.