Let\'s say I have a Postgres database (9.3) and there is a table called Resources. In the Resources table I have the fields id which is an
Resources
id
According sqlalchemy.types.JSON, you can do it like this
from sqlalchemy import JSON from sqlalchemy import cast records = db_session.query(Resource).filter(Resources.data["lastname"] == cast("Doe", JSON)).all()