node+express: linking uploaded files to the respective user
What would be the best way to attach file uploads to the user that
uploaded them?
I was thinking I would create a mongoose model for file uploads with a
schema like this:
user: {type: Schema.Types.ObjectId, ref: 'User'},
url: String
where the url is simply the location of the file uploaded. However, will
this scale well?
Is there a more standard way to do something like this?
No comments:
Post a Comment