-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
Feature Description
The PostgreSQL database was found to be searching in a column with the type "Json" or "Jsonb". Now, in order to search with typeorm, you need to create a queryBuilder and describe the query with the passed parameters.
The Solution
The postgreSQL operator "@>" can be used to solve the json column search problem. To conveniently abstract from the use of the postgreSQL statement, the plan is to create a findOperator "JsonContains" to help solve the json search problem.
this.repo.find({
where: { id: In(ids), address: JsonContains({ city: { id: 12 } }) },
});Considered Alternatives
One alternative is to create a query builder and describe the sql query in it.
Additional Context
No response
Relevant Database Driver(s)
- aurora-mysql
- aurora-postgres
- better-sqlite3
- cockroachdb
- cordova
- expo
- mongodb
- mysql
- nativescript
- oracle
- postgres
- react-native
- sap
- spanner
- sqlite
- sqlite-abstract
- sqljs
- sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.
ImJustRV, isaryy, nigel-loops, g-chanet, iJhefe and 3 more