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

Adonisjs/redis@7.3.4 do not have geo related functions #62

Open
dinesh-suthar-cdp opened this issue Mar 27, 2024 · 0 comments
Open

Adonisjs/redis@7.3.4 do not have geo related functions #62

dinesh-suthar-cdp opened this issue Mar 27, 2024 · 0 comments

Comments

@dinesh-suthar-cdp
Copy link

Package version

7.3.4

Describe the bug

I am running the redis' geo functions like georadius() in my code but it is giving me error:

This is my controller code:

import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import Redis from '@ioc:Adonis/Addons/Redis'

export default class RedisController {
    public async makeConnection({ request }: HttpContextContract) {

        
        const radius = 50  // Specify your radius in meters
      const options = ['WITHDIST', 'WITHCOORD', 'ASC', 'COUNT', '1']

      // Use GEORADIUS command to find the nearest point
      const results = await Redis.georadius('track_wr', 72.8273470257908, 18.9345157490157, radius, 'm', ...options)

      console.log(results);
    }

Error: "message": "Redis_1.default.georadius is not a function",

upon investigating, I found my ioMethods.ts file do not have following array elements:

'geoadd',
'geodist',
'geodistBuffer',
'geohash',
'geohashBuffer',
'geopos',
'georadius',
'georadius_ro',
'georadiusbymember',
'georadiusbymember_ro',
'geosearch',
'geosearchstore',

I

Reproduction repo

No response

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

1 participant