本文整理了Java中com.google.firebase.database.Query.orderByChild
方法的一些代码示例,展示了Query.orderByChild
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.orderByChild
方法的具体详情如下:
包路径:com.google.firebase.database.Query
类名称:Query
方法名:orderByChild
[英]Create a query in which child nodes are ordered by the values of the specified path.
[中]创建一个查询,其中子节点按指定路径的值排序。
代码示例来源:origin: chat-sdk/chat-sdk-android
query = query.orderByChild(Keys.Date).limitToLast(ChatSDK.config().messageHistoryDownloadLimit);
代码示例来源:origin: chat-sdk/chat-sdk-android
public Observable<Message> messageRemovedOn() {
return Observable.create(e -> {
Query query = FirebasePaths.threadMessagesRef(model.getEntityID());
query = query.orderByChild(Keys.Date);
query = query.limitToLast(ChatSDK.config().messageDeletionListenerLimit);
ChildEventListener removedListener = query.addChildEventListener(new FirebaseEventListener().onChildRemoved((snapshot, hasValue) -> {
if(hasValue) {
MessageWrapper message = new MessageWrapper(snapshot);
this.model.removeMessage(message.getModel());
// updateLastMessage().subscribe(new CrashReportingCompletableObserver());
e.onNext(message.getModel());
}
}));
FirebaseReferenceManager.shared().addRef(query, removedListener);
});
}
代码示例来源:origin: TomGrill/gdx-firebase
@Override
public Query orderByChild(String path) {
return new DesktopQuery(query.orderByChild(path));
}
内容来源于网络,如有侵权,请联系作者删除!