How to get user by display name

Hi,
Currently I’m doing a find user in-game.
I’m wondering if there’s a way that I can get a user using their display name instead of ID or username?

I don’t know from what platform you need to get this data from, but here it’s the documentation from the Godot SDK (You can change at the top of the page to whatever SDK you need).

Nakama: User accounts | Heroic Labs Documentation

It’s empty by default, so unless you had the user set this somehow, or you set it copying the username I don’t know, it’ll be empty.

Edit: Oh sorry, you mean to fetch a user by it’s display name instead of they IDs? I got the question wrong.

1 Like

@WeeeeeeW could you talk a little more about your use case? For example, are you exposing a filter for users to search via display name?

Yes, I got a function for my users to find others by their display name, but I don’t really want their username to be the same with their display name.

Our users aren’t indexed by display name so you’ll need to apply a postgres trigram index to the database and use a raw SQL query via the server framework.

We go into further detail about a solution in a similar question asked here:

1 Like