diff --git a/data-serving/data-service/src/controllers/case.ts b/data-serving/data-service/src/controllers/case.ts index be8c5095d..69b58ed94 100644 --- a/data-serving/data-service/src/controllers/case.ts +++ b/data-serving/data-service/src/controllers/case.ts @@ -80,6 +80,7 @@ const caseFromDTO = async (receivedCase: CaseDTO) => { }; } } + aCase.bundleId = new ObjectId(aCase.bundleId) return aCase; }; diff --git a/data-serving/scripts/setup-db/schemas/day0cases.indexes.json b/data-serving/scripts/setup-db/schemas/day0cases.indexes.json index b55dd708a..dc4a62d71 100644 --- a/data-serving/scripts/setup-db/schemas/day0cases.indexes.json +++ b/data-serving/scripts/setup-db/schemas/day0cases.indexes.json @@ -46,6 +46,16 @@ } } }, + { + "name": "bundleIdIdx", + "key": { + "bundleId": -1 + }, + "collation": { + "locale": "en_US", + "strength": 2 + } + }, { "name": "demographicsGenderIdx", "key": { diff --git a/data-serving/scripts/setup-db/schemas/day0cases.schema.json b/data-serving/scripts/setup-db/schemas/day0cases.schema.json index 4175de3de..25cdeb29d 100644 --- a/data-serving/scripts/setup-db/schemas/day0cases.schema.json +++ b/data-serving/scripts/setup-db/schemas/day0cases.schema.json @@ -11,6 +11,9 @@ "__v": { "bsonType": "int" }, + "bundleId": { + "bsonType": "objectId" + }, "list": { "bsonType": "bool" },