diff --git a/dictdatabase/models.py b/dictdatabase/models.py
index 828adf7..bd28ce6 100644
--- a/dictdatabase/models.py
+++ b/dictdatabase/models.py
@@ -91,12 +91,12 @@ def __init__(self, path: tuple, key: str = None, where: Callable[[Any, Any], boo
 		for p in path:
 			pc += p if isinstance(p,  list) else [p]
 		self.path = utils.to_path_str([str(p) for p in pc])
+		self.key = key
+		self.where = where
 		self.op_type = OperationType(self.path, self.key, self.where)
 		# Invariants:
 		# - Both key and where cannot be not None at the same time
 		# - If key is not None, then there is no wildcard in the path.
-		self.key = key
-		self.where = where
 
 
 	def exists(self) -> bool: