javascript – translate the postgres query into Node js using findOne()
I am trying to update an existing postgres query in the Nodejs code base.
Below is the existing query to select based on name
constructor(schema){
this.table = schema.employee_tb;
}
row = await this.table.findOne({ name });
Below is the postgres query I am trying to translate and update the above code into…
select * from table where name="john" and '3467' = ANY(group_number)
I tried
row = await this.table.findOne({ name : 'john' && ANY(group_number): '3467' });
For which it is throwing an error.
Please help, Thanks in advance.
Read more here: Source link