Skip to content

Latest commit

 

History

History
315 lines (257 loc) · 13.5 KB

MongoDB-schema-visualization.md

File metadata and controls

315 lines (257 loc) · 13.5 KB

Mongodb Schema for fixflex 🛠️

Main Layout

img

Collection fixflex.categories

Idx Name Data Type
* 🔑 ⬋ _id objectId
* image object
* image.url string
* image.publicId string
* name object
* name.en string
* name.ar string
* __v int
Indexes
Type Name On
🔑 _id_ ON _id

Collection fixflex.chats

Idx Name Data Type
* 🔑 ⬋ _id objectId
* user string
* tasker string
* ⬈ messages array
* __v int
Indexes
Type Name On
🔑 _id_ ON _id
Relationships
Type Name On
Vir fk_chats_messages ( messages ) ref fixflex.messages (_id)

Collection fixflex.coupons

Idx Name Data Type
* 🔑 _id objectId
* 🔍 code string
* type string
* value int
* expirationDate date
* maxUses int
* remainingUses int
* createdBy string
* createdAt date
* updatedAt date
* __v int
Indexes
Type Name On
🔑 _id_ ON _id
🔍 code_1 ON code

Collection fixflex.log

Idx Name Data Type
* 🔑 _id objectId
* 🔎 timestamp date
* level string
* message string
* meta string
Indexes
Type Name On
🔑 _id_ ON _id
🔎 timestamp_1 ON timestamp

Collection fixflex.messages

Idx Name Data Type
* 🔑 ⬋ _id objectId
* sender string
* message string
* ⬈ chatId string
* createdAt date
* __v int
Indexes
Type Name On
🔑 _id_ ON _id
Relationships
Type Name On
Vir fk_messages_chats ( chatId ) ref fixflex.chats (_id)

Collection fixflex.offers

Idx Name Data Type
* 🔑 ⬋ _id objectId
* taskerId string
* taskId string
* price int
* status string
* message string
* subMessages array
* createdAt date
* updatedAt date
* __v int
Indexes
Type Name On
🔑 _id_ ON _id

Collection fixflex.reviews

Idx Name Data Type
* 🔑 _id objectId
* ⬈ userId string
* ⬈ taskerId string
* ⬈ taskId string
* rating object
* review string
* createdAt date
* updatedAt date
* __v int
Indexes
Type Name On
🔑 _id_ ON _id
Relationships
Type Name On
Vir fk_reviews_users ( userId ) ref fixflex.users (_id)
Vir fk_reviews_tasks ( taskId ) ref fixflex.tasks (_id)
Vir fk_reviews_taskers ( taskerId ) ref fixflex.taskers (_id)

Collection fixflex.taskers

Idx Name Data Type
* 🔑 ⬋ _id objectId
* 🔍 ⬈ userId string
* ⬈ categories array[string]
* ratingAverage object
* ratingQuantity int
* 🔎 location object
* location.coordinates array[double]
* location.type string
* location.radius int
* notPaidTasks array
* totalCanceledTasks int
* totalEarnings int
* netEarnings object
* completedTasks array
* commissionRate double
* createdAt date
* updatedAt date
* __v int
isActive Boolean
Indexes
Type Name On
🔑 _id_ ON _id
🔍 userId_1 ON userId
🔎 location_2dsphere ON location
Relationships
Type Name On
Vir fk_taskers_users ( userId ) ref fixflex.users (_id)
Vir fk_taskers_categories ( categories ) ref fixflex.categories (_id)

Collection fixflex.tasks

Idx Name Data Type
* 🔑 ⬋ _id objectId
* ⬈ userId string
* dueDate object
dueDate.flexible Boolean
dueDate.on date
* time array
* title string
* details string
* imageCover object
* imageCover.publicId string
* ⬈ categoryId string
* status string
* 🔎 location object
* location.coordinates array[double]
* location.type string
location.online Boolean
city string
* budget int
* ⬈ offers array[string]
* paymentMethod string
* paid Boolean
images array[object]
* images.url string
images.publicId string
images._id objectId
* createdAt date
* updatedAt date
* __v int
⬈ acceptedOffer string
commission object
⬈ taskerId string
Indexes
Type Name On
🔑 _id_ ON _id
🔎 location_2dsphere ON location
Relationships
Type Name On
Vir fk_tasks_offers ( offers ) ref fixflex.offers (_id)
Vir fk_tasks_categories ( categoryId ) ref fixflex.categories (_id)
Vir fk_tasks_users ( userId ) ref fixflex.users (_id)
Vir fk_tasks_taskers ( taskerId ) ref fixflex.taskers (_id)
Vir fk_tasks_offers_0 ( acceptedOffer ) ref fixflex.offers (_id)

Collection fixflex.transactions

Idx Name Data Type
* 🔑 _id objectId
* 🔍 transactionId string
* amount int
* transactionType string
* pinding Boolean
* success Boolean
* orderId string
* ⬈ taskId string
* createdAt date
* updatedAt date
* __v int
⬈ taskerId string
Indexes
Type Name On
🔑 _id_ ON _id
🔍 transactionId_1 ON transactionId
Relationships
Type Name On
Vir fk_transactions_tasks ( taskId ) ref fixflex.tasks (_id)
Vir fk_transactions_taskers ( taskerId ) ref fixflex.taskers (_id)

Collection fixflex.users

Idx Name Data Type
* 🔑 ⬋ _id objectId
* firstName string
* lastName string
* 🔍 email string
* emailVerified Boolean
* password string
* profilePicture object
* profilePicture.url string
* profilePicture.publicId string
* role string
* active Boolean
* phoneNumVerified Boolean
* createdAt date
* updatedAt date
* __v int
🔍 phoneNumber string
phoneNumVerificationCode string
phoneNumVerificationCodeExpiration date
passwordResetCode string
passwordResetCodeExpiration date
passwordResetVerified Boolean
Indexes
Type Name On
🔑 _id_ ON _id
🔍 email_1 ON email
🔍 phoneNumber_1 ON phoneNumber