Reputation: 5460
I'm new to MEAN and trying to get my feet wet with implementing an application. Basically I'm trying to make a photo app where each user can store photos.
My idea is to implement it as follows:
Each uploaded photo will have a schema as:
var photoSchema = mongoose.Schema({
photoFile: String,
photoDescription: String
});
photoFile
contains the location where the file is stored.
Then I will maintain another schema to track the photos:
var photos = mongoose.Schema({
username: String,
photoObjects: [photoObject.id]
});
So, is this a good structure to maintain photos of users using Mongo? If not I'd appreciate some help in knowing what is wrong with this approach and how to improve it.
Thank you.
Upvotes: 0
Views: 46
Reputation: 1437
I would add Last Updated and created. Metadata never hurts in production applications and debug scenarios.
Upvotes: 1