Answer the question
In order to leave comments, you need to log in
How to use SQL query with to_tsquery and include?
I have two associated postgres sequelize models Lead and Unit.
Lead = {
unitId: {
type: DataTypes.INTEGER,
references: {
model: 'Unit',
key: 'id',
deferrable: sequelize.Deferrable.INITIALLY_IMMEDIATE,
},
},
name: {
type: DataTypes.STRING,
}
}
Unit = {
status: {
type: DataTypes.STRING,
},
title: {
type: DataTypes.STRING,
},
}
SELECT * FROM "Lead" WHERE "postVector" @@ to_tsquery('english','query')
[
{name: examplename, status: examplestatus, title: exampletitle},
{name: examplename2, status: examplestatus2, title: exampletitle2},
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question