Sequelize WHERE sequelize.fn(...) AND something='something' ordering issue
I have a Sequelize findOne function that looks to select a row where the given point intersects a polygon (col 'geom') AND status = 'active'. var point = sequelize.fn('ST_GeomFromText', 'POINT(' + lng + ' ' + lat +')', 4326); var intersects = sequelize.fn('ST_Intersects', sequelize.col('geom'), point); GeoCounty.findOne({ attributes: ['id', 'name' ], where: { status: 'active', $and: intersects }, plain: true }) As of right now, it works just fine.
https://stackoverflow.com/questions/43274383/sequelize-where-sequelize-fn-and-something-something-ordering-issue