Skip to content
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

Fail querying with JSONB column postgres #5582

Closed
MugeSo opened this issue Mar 14, 2016 · 2 comments
Closed

Fail querying with JSONB column postgres #5582

MugeSo opened this issue Mar 14, 2016 · 2 comments

Comments

@MugeSo
Copy link

MugeSo commented Mar 14, 2016

var Model = sequelize.define('something', {
    jsonbRecord: {
        type: Sequelize.JSONB,
        allowNull: false
    }
});

Model.find({
    where: {
        jsonbRecord: { prop: ["foo", "bar"] }
    }
});

Then:

Unhandled rejection SequelizeDatabaseError: operator does not exist: text = text[]
@MugeSo MugeSo changed the title Fail querying on JSONB record postgres Fail querying with JSONB column postgres Mar 14, 2016
@mickhansen
Copy link
Contributor

What are you trying to do exactly? We don't support equal queries on an array. You need to use contains, in or whatever.

@MugeSo
Copy link
Author

MugeSo commented Mar 14, 2016

@mickhansen thanks.
To tell the truth, I don't do that. sequelize-fixutres does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants