With the new query support, you could store lowercased name in a subkey (/users/Kai/case_folded_name == “kai”).
Then something like usersRef.orderByChild(“case_folded_name”).equalTo(“kai”) should give you the matching user(s).
Don’t forget .indexOn in rules to actually make the query efficient.
It’s becoming standard to offer autocompletion for user mentions. I think using startAt("kai").limit(10) instead of equalTo("kai") would easily support (somewhat dumb) prefix-based autocompletion (you just have to filter the results to those actually starting with “kai”).
But if you want to also complete based on full first/last names, or any substrings, and show the best N matches based on some metric (this matters if you want to already give relevant completions for @k or even @), it will require more work…
Caveats:
@kai refer to? Perhaps it’s simpler to force lowercase usernames but show user-chosen display name in UI. But then what do you do when a user accustomed to display names assumes that just typing @Display Name works (ignorign autocomplete’s offer of @username Display Name). SE has a complex DWIM algorithm, but I wouldn’t go there if I can avoid it…--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/IEQhQrMaGro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.