Firebase searching by character

霸气de小男生 提交于 2019-12-03 00:42:56

Try this

Query Q = mDatabase.child("Users").orderByChild("Username").startAt(newText).endAt("~");

It happens because you are using:

Query Q = mDatabase.child("Users").orderByChild("Username").equalTo(newText);

The equalsTo creates a query constrained to only return child nodes with the given value.

You should use the method startAt which creates a query constrained to only return child nodes with a value greater than or equal to the given value, using the given orderBy directive or priority as default.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!