add unique index to both token fields

This commit is contained in:
Shane Kilkelly 2017-10-27 14:58:55 +01:00
parent a57827458d
commit 239f56ca0e

View file

@ -33,8 +33,8 @@ ProjectSchema = new Schema
imageName : { type: String } imageName : { type: String }
track_changes : { type: Object } track_changes : { type: Object }
tokens : tokens :
readOnly : { type: String } readOnly : { type: String, index: {unique: true} }
readAndWrite : { type: String } readAndWrite : { type: String, index: {unique: true} }
tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ] tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ]
tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ] tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ]
overleaf : overleaf :