I have a simple postgres ltree query
select * from data_objects WHERE path ~ 'root.*{1}';
I would like to implement this in sequelize, but there is no mapping for the ~ operator.
Is it possible to override the mappings? or do I have to use a raw sql query?
Found the solution:
params.path = {
$regexp:'root.*{1}'
};
Which translates as
where "path" ~ 'root.*{1}'
I hadn't seen the $regexp operator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With