Updating the message model

Next, we are going to update our message model. We are going to save the labels, safe search result, and Cloudinary upload details, as well in the message. These values will be populated only for an image upload and not a text upload. Update servermodelsmessage.ts as follows:

// SNIPP SNIPP
import * as mongoose from 'mongoose';
const Schema = mongoose.Schema;

const messageSchema = new Schema({
// SNIPP SNIPP
labels: [{
type: Schema.Types.Mixed,
default: []
}],
cloudinaryProps: {
type: Schema.Types.Mixed
},
safeSearchProps: {
type: Schema.Types.Mixed
}
});

const Message = mongoose.model('Message', messageSchema);

export default Message;
// SNIPP SNIPP
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.80.34