Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis OM Find Non-Null #232

Open
j0hnw0rk3r opened this issue Mar 25, 2024 · 2 comments
Open

Redis OM Find Non-Null #232

j0hnw0rk3r opened this issue Mar 25, 2024 · 2 comments

Comments

@j0hnw0rk3r
Copy link

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);
        }
    }
@j0hnw0rk3r j0hnw0rk3r changed the title Redis OM Find Null Redis OM Find Non-Null Mar 25, 2024
@KemikalGeneral
Copy link

I'm pretty sure the last time I checked, you can't search on null.

@MR4online
Copy link

No, you can't seach by NULL (see my question #224 ).
My workaround is writing "NULL" (the string) on it, search for this and replace the js-objects value with real null later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants