TimetableAPI-Upgrade #64
@ -64,8 +64,8 @@ async function findPartialMatchByTiploc(tiplocArray: string[]) {
|
|||||||
const pipeline = [
|
const pipeline = [
|
||||||
{
|
{
|
||||||
$addFields: {
|
$addFields: {
|
||||||
reversedStops: {
|
reversedTiplocs: {
|
||||||
$reverseArray: "$stops",
|
$reverseArray: "$tiplocs",
|
||||||
},
|
},
|
||||||
reversedQueryArray: {
|
reversedQueryArray: {
|
||||||
$reverseArray: tiplocArray,
|
$reverseArray: tiplocArray,
|
||||||
@ -78,7 +78,7 @@ async function findPartialMatchByTiploc(tiplocArray: string[]) {
|
|||||||
$gt: [
|
$gt: [
|
||||||
{
|
{
|
||||||
$indexOfArray: [
|
$indexOfArray: [
|
||||||
"$reversedStops",
|
"$reversedTiplocs",
|
||||||
{
|
{
|
||||||
$arrayElemAt: ["$reversedQueryArray", 0],
|
$arrayElemAt: ["$reversedQueryArray", 0],
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ async function findPartialMatchByTiploc(tiplocArray: string[]) {
|
|||||||
skipStops: {
|
skipStops: {
|
||||||
$subtract: [
|
$subtract: [
|
||||||
{
|
{
|
||||||
$size: "$stops",
|
$size: "$tiplocs",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$size: tiplocArray,
|
$size: tiplocArray,
|
||||||
|
Loading…
Reference in New Issue
Block a user