diff --git a/models/observations.js b/models/observations.js index a105286e..3acbc11b 100644 --- a/models/observations.js +++ b/models/observations.js @@ -1,8 +1,14 @@ module.exports = { name: "observations", schema: { - name: String, - description: String, + name: { + type : String, + index : true + }, + description: { + type : String, + index : true + }, createdBy: { type : String, index : true @@ -53,6 +59,10 @@ module.exports = { type: String, index: true }, - userRoleInformation : Object + userRoleInformation : Object, + deleted : { + type : Boolean, + index: true + } } }; \ No newline at end of file diff --git a/models/surveySubmissions.js b/models/surveySubmissions.js index b516c344..6e204fb4 100644 --- a/models/surveySubmissions.js +++ b/models/surveySubmissions.js @@ -43,7 +43,10 @@ module.exports = { type : Boolean, index: true }, - surveyInformation: Object, + surveyInformation: { + name: { type: String, index: true }, + description: { type: String, index: true } + }, appInformation : Object, userRoleInformation : Object } diff --git a/models/surveys.js b/models/surveys.js index bc8c1168..2453686e 100644 --- a/models/surveys.js +++ b/models/surveys.js @@ -1,8 +1,14 @@ module.exports = { name: "surveys", schema: { - name: String, - description: String, + name: { + type: String, + index: true + }, + description: { + type: String, + index: true + }, createdBy: { type: String, index: true, diff --git a/module/surveySubmissions/helper.js b/module/surveySubmissions/helper.js index 35e1dd7e..3ebce607 100644 --- a/module/surveySubmissions/helper.js +++ b/module/surveySubmissions/helper.js @@ -457,11 +457,11 @@ module.exports = class SurveySubmissionsHelper { if ( filter && filter !== "" ) { if( filter === messageConstants.common.CREATED_BY_ME ) { - matchQuery["$match"]["isAPrivateProgram"] = { + submissionMatchQuery["$match"]["isAPrivateProgram"] = { $ne : false }; } else if ( filter === messageConstants.common.ASSIGN_TO_ME ) { - matchQuery["$match"]["isAPrivateProgram"] = false; + submissionMatchQuery["$match"]["isAPrivateProgram"] = false; } }