I am using aws s3 for storing files. There are two options to store urls of these files in mongodb.
- Store full url of image eg: "https://aws.s3/path/key"
- Store only key in mongodb and and calculate(using aggregation projection or mongoose virtuals) full path every time I fetch docs
I just want to know which one is better and why?