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

View File

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