You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sequelize omitting field when casting to array #6572
I am attempting to use the postgres citext module with Sequelize, so far it has worked well by using literals for queries and defining the type in the model. However because Sequelize does not understand what the citext type is, it returns my citext arrays as strings. e;g "{item 1, item2}"
To get around this I am trying to cast the citext array to a TEXT or VARCHAR array in the query, however when I do this, Sequelize does not show that field at all.
If I set raw: true, the field shows fine, and as an array.
Activity
felixfbecker commentedon Sep 9, 2016
You need to tell sequelize under which alias you want to have your expression. I believe the syntax is
but please refer to the docs
SuperManifolds commentedon Sep 10, 2016
Worked! Can't believe I missed that, thank you so much.