when writing a query using multiple 'or' clauses, it will return the records that match the first 'or' clause and ignore the 2nd or clause. This is the code that I have attempted but doesnt work.
Employee.find()
.where({
or:[
{
locationId:employee.currentLocation.id
},
{
facilityId:employee.facilityId,
userName:employee.userName,
accountOwner:true
}
]
},
{
or:[
{
employeeId:{
startsWith:params.search.value
}
},
{
fullName:{
startsWith:params.search.value
}
},
{
street:{
startsWith:params.search.value
}
},
{
emailAddress:{
startsWith:params.search.value
}
},
{
employeeType:{
startsWith:params.search.value
}
},
{
status:{
startsWith:params.search.value
}
}
]
})
when writing a query using multiple 'or' clauses, it will return the records that match the first 'or' clause and ignore the 2nd or clause. This is the code that I have attempted but doesnt work.