Skip to content

Commit 50d5333

Browse files
authored
fixed type error of find()
1 parent 9e0a8b6 commit 50d5333

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

filexdb/collection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def __find_one(self, query: Mapping = None) -> Document | None:
133133
return _result
134134
"""
135135

136-
def find(self, query: Mapping = None, limit = None) -> List[Document | None]:
136+
def find(self, query = None, limit = None) -> List[Document | None]:
137137
"""
138138
Finds all ``Document`` of ``Collection``.
139139
@@ -147,6 +147,10 @@ def find(self, query: Mapping = None, limit = None) -> List[Document | None]:
147147
"""
148148
if type(limit) == type((1,)):
149149
raise TypeError('Limit should be a tuple')
150+
151+
if type(query) == type({}):
152+
raise TypeError('Limit should be a JOSN Object')
153+
150154
# Default result
151155
_result = []
152156

0 commit comments

Comments
 (0)