redis-om-node
redis-om-node copied to clipboard
Redis OM Find Non-Null
Hi, can anyone help please? I'm try to integrate geospatial search together with filtering object keys containing null values and I only need to find all records that are 'verified'. Can someone point me into the right direction? The following code I have written seems to throw an error:
async searchNearby(longitude: number, latitude: number, radius: number = 10) {
try {
// Perform geospatial search
const results = await branchesRepository.search()
.where("verified_at").not.eq(null)
.and('location')
.inRadius(
circle => circle
.longitude(longitude)
.latitude(latitude)
.radius(radius)
.kilometers
)
.return.all()
return results;
} catch (e) {
console.log(e);
}
}
I'm pretty sure the last time I checked, you can't search on null.
No, you can't seach by NULL (see my question https://github.com/redis/redis-om-node/issues/224 ).
My workaround is writing "NULL" (the string) on it, search for this and replace the js-objects value with real null later