From 5ab1c9794c75ddbb351d397cdf0fd44b03e9fb82 Mon Sep 17 00:00:00 2001 From: William Newman <3382274+newmanw@users.noreply.github.com> Date: Thu, 7 Mar 2024 09:07:22 -0700 Subject: [PATCH] Add location collection index for exports --- service/src/models/location.js | 1 + 1 file changed, 1 insertion(+) diff --git a/service/src/models/location.js b/service/src/models/location.js index a2bc38dc8..d177183e5 100644 --- a/service/src/models/location.js +++ b/service/src/models/location.js @@ -26,6 +26,7 @@ LocationSchema.index({ 'properties.timestamp': 1, _id: 1 }); LocationSchema.index({ 'userId': 1 }); // TODO: should add _id to the end of the index for consistent ordering LocationSchema.index({ 'properties.user': 1, 'properties.timestamp': 1 }); +LocationSchema.index({ eventId: 1, userId: 1, 'properties.timestamp': 1, _id: 1 }, { background: true }); // Creates the Model for the User Schema var Location = mongoose.model('Location', LocationSchema);