我需要按日期排序项目,但显然我需要降序排序以正确的顺序显示帖子...
import {
AngularFireDatabase
} from 'angularfire2/database';
import 'rxjs/add/operator/map';
/*
Generated class for the FirebaseProvider provider.
See https://angular.io/docs/ts/latest/guide/dependency-injection.html
for more info on providers and Angular 2 DI.
*/
@Injectable()
export class FirebaseProvider {
constructor(public afd: AngularFireDatabase) {}
getPostsItems() {
return this.afd.list('/Posts/', {
query: {
orderByChild: "date",
}
});
}Run Code Online (Sandbox Code Playgroud)
此查询返回一个上升顺序,我需要一个后代订单,它没有在Firebase Web中解释.
我需要哪些查询?
sorting firebase ionic-framework firebase-realtime-database ionic2