13 lines
345 B
Python
13 lines
345 B
Python
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)
|