Is there a way to upload files directly to a mongodb schema?
I'm currently developing an API. There's a form that consists of multiple fields including 3 different files (as in PDFs) but I haven't found a way to store them in the schema so it's fast to access.
I think the schema should look something like this:
const SomeSchema = mongoose.schema({
data: {
type: String,
required: true
},
data:{
type: Date,
required: true
}
data:{
type: String,
required: true
}
file:
type: File(?),
required: true
)}
But I don't think this is correct since I have watched some tutorials and they don't store files in the same collection. Is it not possible?