In MongoDB, How do i restrict the data entry bases on 3 fields RegisterUserId ,PageId and IsFavourite. None of them is unique? what should the query be?
Below is my Schema
var FavMasterSchema = new Schema({
FavUrl:String,
RegisterUserId : { type: Schema.Types.ObjectId, ref: 'User',select: false},
PageId: { type: Schema.Types.ObjectId},
IsFavourite: {type: Boolean,default:false}
});
module.exports = mongoose.model('t_FavMaster', FavMasterSchema);