baseddata.io/backend/models/mongodb_handler.py

13 lines
345 B
Python
Raw Normal View History

2024-09-20 17:49:31 +01:00
class MongoDBHandler:
def __init__(self, collection):
self.collection = collection
def find_limit(self, limit: int):
return self.collection.find().limit(limit)
def find_one(self, query):
return self.collection.find_one(query)
def aggregate(self, query):
return self.collection.aggregate(query)