From 286026fcc0af48de663120cf2f5bcdea56466f37 Mon Sep 17 00:00:00 2001 From: Todd Greenstein Date: Fri, 1 Jul 2016 07:16:16 -0700 Subject: [PATCH] Added Array Indexing Support for Query --- model/flightPath.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/flightPath.js b/model/flightPath.js index 0e9c4e7..bf69bfc 100644 --- a/model/flightPath.js +++ b/model/flightPath.js @@ -48,7 +48,7 @@ module.exports.findAll = function (from, to, leave, user, done) { queryPrep = "SELECT r.id, a.name, s.flight, s.utc, r.sourceairport, r.destinationairport, r.equipment " + "FROM `" + config.couchbase.bucket + "` r UNNEST r.schedule s JOIN `" + - config.couchbase.bucket + "` a ON KEYS r.airlineid WHERE r.sourceairport='" + queryFrom + + config.couchbase.bucket + "` a ON KEYS r.airlineid WHERE r.type='route' AND r.sourceairport='" + queryFrom + "' AND r.destinationairport='" + queryTo + "' AND s.day=" + convDate(leave) + " ORDER BY a.name"; db.query(queryPrep, user, function (err, flightPaths) {