Unable to Retrieve List of Groups in Nakama Go Server

Hi everyone,

I’m trying to retrieve a list of groups in Nakama using the Go server, but I’m encountering issues even with the code provided in the documentation.
this is the code in server framework docs

groupName := "Heroic"
langTag := "en"
members := 10
open := true
limit := 100
cursor := ""

list, cursor, err := nk.GroupsList(ctx, groupName, langTag, &members, &open, limit, cursor)

if err != nil {
    logger.WithField("err", err).Error("Group list error.")
} else {
    for _, g:= range list {
        logger.Info("ID %s - open? %b cursor: %s", g.Id, g.Open, cursor)
    }
}

and when I use it I get

name filter cannot be combined with any other filter

how I can search for groups in server?
and is there any way to search groups by its metadata

nakama-common v1.31.0
nakama-pluginbuilder:3.21.0
nakama:3.21.0

thanks

Hello @peyman1959,

I’d advise you to upgrade to Nakama latest (v3.26.0) as your version is almost a year old at this point.

As detailed in the groups docs, name can be used only to search for groups with specific suffixes plus wildcard (%) but it is mutually exclusive with other filters, so if you’re using a non-empty name string none of the other filters can be used.

As a note, to omit edgeCount you’d need to set it to a value < 0.

Search by metadata is also not supported, you’d have to list all groups (by omitting all the filters) and select by your metadata criteria in-memory.

Best.