Hello I´m searching for users this way
const findUsers = (name) => {
return firebase
.firestore()
.collection("users")
.where("name", "==", name)
.get();
};
it works fine if I do findUsers("Michael Jackson") but it won´t work if I do findUsers("michael-jackson")
I´m using
const friendlyName = (string) => string.replace(/\W+/g, "-").toLowerCase();
to convert names to a friendly name that is easier to remember and good for sharing urls. I need to inverse that for searching? thank you!