-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(collections): collections module for object management wrt mongodb #5
base: main
Are you sure you want to change the base?
Conversation
T = TypeVar("T") | ||
|
||
|
||
class BaseCollection(Generic[T]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a parent interface class for this that is agnostic to the specific database vendor? And have a mongodb one inherit from it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can do this later...something to consider.
|
||
@staticmethod | ||
def get_database() -> AsyncIOMotorDatabase: | ||
"""Return pymongo.database.Database for database connection based from current client connection.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come this is not getting complained by linting for being too long?
if session: | ||
raise | ||
logger.exception(f"Error bulk write:\n{ops}") | ||
return {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a few unit tests for the BaseCollection and UserCollection modules?
@amadolid I left some comments. Take a look. |
Adds the collections module for the interfacing with mongodb.