The Users
collection in MongoDB is utilized to store comprehensive user information. Each document in this collection represents a unique user and includes the following fields:
- _id: (String) Unique identifier for referencing and identifying individual users.
- email: (String) Stores the user's email address, essential for communication and authentication.
- password: (String) Securely stores the hashed and salted password to protect user credentials.
- firstName: (String) Capture the user's first name.
- lastName: (String) Capture the user's last name.
- createdAt: (Date) Records the Date of when the user account was initially registered.
- updatedAt: (Date) Tracks the Date of the most recent changes made to the user's information.
- isVerified: (Boolean) Indicates whether user is verified or not
- userType: (String) Describes the type of the user (e.g., CUSTOMER, ADMIN).
The Keys
collection in MongoDB is designed to store API keys created by users. Each document in this collection represents a unique API key and includes the following fields:
- _id: (String) Serves as a unique identifier for referencing and identifying individual API keys.
- user: (Reference) References the user who owns the API key, establishing a link to the corresponding user document in the
Users
collection. - key: (String) Stores the actual API key string for authentication and authorization purposes.
- keyDescription: (String) Provides a description of the API key for better understanding and management.
- usageCount: (Number) Tracks the number of times the API key has been utilized.
- createdAt: (Date) Records the Date of when the API key was initially created.
- updatedAt: (Date) Tracks the Date of the most recent changes made to the API key.
The Subscriptions
collection in MongoDB is specifically designed to store information about user subscriptions. Each document in this collection represents a unique subscription and includes the following fields:
- _id: (String) Serves as a unique identifier for referencing and identifying individual subscriptions.
- user: (Reference) References the user who is subscribed, establishing a link to the corresponding user document in the
Users
collection. - subscriptionType: (String) Describes the type of subscription the user currently holds.
- keyLimit: (Number) Specifies the number of keys that can be created in this subscription plan.
- usageLimit: (Number) Represents the usage limit associated with the subscription plan.
- isActive: (Boolean) Indicates whether the subscription is currently active or not, providing a quick status check.
- createdAt: (Date) Records the Date of when the subscription was initially created.
- updatedAt: (Date) Tracks the Date of the most recent changes made to the subscription.
The Images
collection in MongoDB is dedicated to storing information about images provided by the API. Each document in this collection represents a unique image and includes the following fields:
- _id: (String) Serves as a unique identifier for referencing and identifying individual images.
- imageUrl: (String) Stores the URL of the image, allowing for easy retrieval and display within the application.
- uploadedAt: (Date) Records the Date of when the image was initially uploaded to the system.
- ImageUsageCount: (Number) Tracks the number of times the image has been fetched, providing insights into its popularity or usage.
- createdAt: (Date) Records the Date of when the image record was initially created.
- updatedAt: (Date) Tracks the Date of the most recent changes made to the image record.
The ImageLogs
collection in MongoDB is employed to record each time an image is fetched. Each document in this collection represents a unique access log and includes the following fields:
- _id: (String) Serves as a unique identifier for referencing and identifying individual access logs.
- image: (Reference) References the image that was accessed, establishing a link to the corresponding document in the
Images
collection. - Date: (Date) Records the Date of when the access event occurred.
- apiKeyId: (Reference) References the API key used for access, linking to the corresponding document in the
Keys
collection.
The ContactUs
collection in MongoDB is designated for storing data related to user interactions through the "Contact Us" feature. Each document in this collection represents a unique contact entry and includes the following fields:
- _id: (String) Serves as a unique identifier for referencing and identifying individual contact entries.
- name: (String) Captures the name of the individual who submitted the contact request.
- email: (String) Records the email address of the individual for communication purposes.
- message: (String) Stores the content of the message submitted through the "Contact Us" form.
- activityStatus: (Boolean) Boolean value indicating the current status of the contact entry, useful for tracking the processing status.
- assignedTo: (String) Specifies the person or department assigned to handle the contact request.
- createdAt: (Date) Records the Date of when the contact entry was initially created.
- updatedAt: (Date) Tracks the Date of the most recent changes made to the contact entry.
The UserToken
collection in MongoDB is dedicated to storing information related to user tokens. Each document in this collection represents a unique user token entry and includes the following fields:
- token: (String) Stores the actual user token string for authentication or authorization purposes.
- type: (String) Describes the purpose or type of the user token (e.g., FORGOT, VERIFY).
- user: (Reference) References the user associated with the token, linking to the corresponding user document in the
Users
collection. - createdAt: (Date) Records the Date of when the token entry was initially created.
- expireAt: (Date) Indicates the Date when the user token is set to expire.