Adjust pis query to check last element

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-04-24 12:57:40 +01:00
parent 1c944e9ae1
commit 3017981090
1 changed files with 13 additions and 13 deletions

View File

@ -16,9 +16,9 @@ async function findPisByOrigDest(start,end) {
]
},
$expr: {
$eq: [
{ $arrayElemAt: [ "$stops", 0 ] },
firstCrs
$and: [
{ $eq: [{ $arrayElemAt: [ "$stops", -1 ] }, lastCrs] },
{ $eq: [{ $arrayElemAt: [ "$stops", 0 ] }, firstCrs] }
]
}
}