Ensure a team overleaf id is unique

This commit is contained in:
Alberto Fernández Capel 2018-05-23 16:11:28 +01:00
parent c8977ab9d6
commit 8a55994f64

View file

@ -19,7 +19,11 @@ SubscriptionSchema = new Schema
planCode: String
allowed: {type: Boolean, default: true}
overleaf:
id: { type: Number }
id:
type: Number
index:
unique: true,
partialFilterExpression: {'overleaf.id': {$exists: true}}
SubscriptionSchema.statics.findAndModify = (query, update, callback)->