Fix bugs
Use Not(IsNull())
This commit is contained in:
parent
5a3ea38bbf
commit
e7dd5e155d
7 changed files with 27 additions and 13 deletions
|
@ -128,6 +128,20 @@ query.andWhere(new Brackets(qb => {
|
|||
}));
|
||||
```
|
||||
|
||||
### Not `null` in TypeORM
|
||||
```ts
|
||||
const foo = await Foos.findOne({
|
||||
bar: Not(null)
|
||||
});
|
||||
```
|
||||
のようなクエリ(`bar`が`null`ではない)は期待通りに動作しない。
|
||||
次のようにします:
|
||||
```ts
|
||||
const foo = await Foos.findOne({
|
||||
bar: Not(IsNull())
|
||||
});
|
||||
```
|
||||
|
||||
### `null` in SQL
|
||||
SQLを発行する際、パラメータが`null`になる可能性のある場合はSQL文を出し分けなければならない
|
||||
例えば
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue