Skip to content

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

@dinesh-suthar-cdp

Description

@dinesh-suthar-cdp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions