diff --git a/API/database.py b/API/database.py index 7e50242..c15bd44 100644 --- a/API/database.py +++ b/API/database.py @@ -9,7 +9,7 @@ def __init__(self, uri="mongodb://localhost:27017/", db_name="ImageDB"): self.db = self.client[db_name] def find(self, collection, query=None): - return self.db[collection].find(query) + return list(self.db[collection].find(query)) def insert_one(self, collection, document): return self.db[collection].insert_one(document) @@ -20,5 +20,5 @@ def find_one(self, collection, filter, projection=None): def find_one_and_delete(self, collection, query): return self.db[collection].find_one_and_delete(query) - def update_one(self, collection, filter_query, update_data): - return self.db[collection].update_one(filter_query, {"$set": update_data}) \ No newline at end of file + def update_one(self, collection, filter, update): + return self.db[collection].update_one(filter, update) \ No newline at end of file