Simple implementation of a database to enable OOP.
Index specifier for database in the cluster.
Index specifier for collection in the database.
Gets data corresponding to
uid (primary key - user/sender/registration ID).
The data is broken down into a dictionary to return as an extra step for integrity.
Deletes data corresponding to
uid (primary key).
Database.**`insert_data(uid, uni_id=None, uni_pw=None):
Inserts data into database for a registered user. If credentials are not supposed to be remembered, only user/sender ID is stored.
uid and inserts registration data accordingly. Inserts two sets due to the primary key relation.
A good idea to keep user-data as in JSON format with the following keys:
_id: User ID (Primary Key)
uni_id: User's University ID for login (ENCRYPTED)
uni_pass: User's University Password for login (ENCRYPTED)
_id: User ID (Candidate Key)
reg_id: User's Registration ID (Candidate Key)