Skip to content

Commit

Permalink
feat: improve mongo indexes
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu <matthieu.perrin@montreal.ca>
  • Loading branch information
mtlmatt committed Jul 9, 2024
1 parent 62c5abc commit 486de91
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
3 changes: 1 addition & 2 deletions le-taxi-api-node.js/Jenkinsfile-operatorAndMotor
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ ctx = pipeline.createContext([
overrides:[
"prod": [
rateLimiting: [
perMinute: 1800,
perSecond: 30
perSecond: 60
],
],
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// All the indexes we should have in mongo
db.latestTaxiPositions.createIndex( { "receivedAt": 1 }, { name: "expiration", expireAfterSeconds: 120 } );

db.latestTaxiPositions.createIndex(
{ "location" : "2dsphere" },
{
name: "locationStandard"
partialFilterExpression: { "taxi.isSpecialNeedVehicle" : false }
}
);

db.latestTaxiPositions.createIndex(
{ "location" : "2dsphere" },
{
name: "locationMinivan"
partialFilterExpression: {
"taxi.isMpv" : true,
"taxi.isSpecialNeedVehicle" : false
}
}
);

db.latestTaxiPositions.createIndex(
{ "location" : "2dsphere" },
{
name: "locationSpecialNeed"
partialFilterExpression: { "taxi.isSpecialNeedVehicle" : true }
}
);

0 comments on commit 486de91

Please sign in to comment.