-
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
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
Labels
No labels