What I’m trying to conceive of is how should I approach this problem of having a marketplace e.g. where jobs are and can be searched for and then each job.
I feel like I would want a model for jobs and that model would be made up an array of references to every job within it’s collection. How while I feel that’s the structure when I say it out loud it seems to not make sense. A single monolithic collection with all the references to each ‘job’ collection seems incorrect.
Just a little detail, just to help give some visuals for those who wish it.
// using a mongoose-esqe seudo code here
job.schema = {
title: "web developer",
description: 'lots of words here",
company: "",
contact: ["contact details"],
other-stuff: ....
}
// ‘Jobs/marketplace’ of roles.
jobs.schema = {
jobs: [{
type: mongoose.Schema.Types.ObjectId,
ref: "job"
},
{
type: mongoose.Schema.Types.ObjectId,
ref: "job"
}]
}
Now this seems a little crazy to me, but I’m not really sure how to change it for the better. I’d really appreciate it. I’m doing this for a small side hustle project just to learn more about Mongo, so please don’t feel that any feedback needs to represent a high end finished project just a nice push towards something more practical that I can iterate on over time. I just don’t want to totally break it with something so terribly conceived that I’d have to completely rethink it as my knowledge on the topic matures.
Your kind assistance is greatly appreciated. Thank you!!