I’m trying to add an index on my collections but even the code provided in the documentation fails. When I try this code
local nk = require("nakama")
local name = "IndexName"
local collection = "CollectionName"
local key = "KeyName"
local fields = {"field1", "field2"} -- Only objects containing any of these keys and respective values are indexed.
local maxEntries = 1000
local err = nk.register_storage_index(name, collection, key, fields, maxEntries)
It fails with
{"level":"fatal","ts":"2023-10-16T17:25:06.904Z","caller":"main.go:158","msg":"Failed initializing runtime modules","error":"data/modules/test.lua:9: attempt to call a non-function object\nstack traceback:\n\tdata/modules/test.lua:9: in main chunk\n\t[G]: ?"}