Handling null and undefined values in where conditions
Default Behavior
// Both queries will return all posts, ignoring the text property
const posts1 = await repository.find({
where: {
text: null,
},
})
const posts2 = await repository.find({
where: {
text: undefined,
},
})Configuration
Null Behavior Options
'ignore' (default)
'ignore' (default)'sql-null'
'sql-null''throw'
'throw'Undefined Behavior Options
'ignore' (default)
'ignore' (default)'throw'
'throw'Using Both Options Together
Works with all where operations
Query Builders
Repository Methods
Last updated