New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting JSON fields in where clause #4257

tmont opened this Issue Aug 4, 2015 · 1 comment


2 participants

tmont commented Aug 4, 2015

I can't really figure if this is supported or not. I'm basically trying to query by equality on a boolean value inside a JSON object:

  where: {
    someJsonColumn: {
      someProperty: {
        $eq: true

This throws a noperator does not exist: text = boolean error. Basically the query needs a ::boolean cast at the end of it, and I'm not totally sure if that's even possible in Sequelize.

As a workaround, I can just change true to 'true', but I'd rather not do that if I don't have to.


This comment has been minimized.


janmeier commented Aug 5, 2015

I think I talked with @mickhansen about this previously, and we'd really like this to be transparent for the user, so the value is casted automagically.

@janmeier janmeier added the feature label Aug 5, 2015

@janmeier janmeier closed this in fe3e1c5 Aug 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment