Open moblizeit opened 2 years ago
This issue does not seem to follow the issue template. Make sure you provide all the required information.
Compat way:
this.db.list("/users/" + userKey + "/cards", ref => ref.orderByChild('_date'))
Firebase 9 Modular way
import {
Database,
ref,
listVal,
query,
orderByChild,
} from '@angular/fire/database';
constructor(private db: Database) {}
...
const listRef = ref(this.db, `/users/${userKey}/cards`;
const qry = query(listRef, orderByChild('_date'));
listVal(qry)
.pipe(takeUntil(this.$destroy))
.subscribe((dataList) => {
// your listed data
});
Version info
Angular: "@angular/core": "~13.0.0",
Firebase: "firebase": "^9.6.1",
AngularFire: "@angular/fire": "^7.2.0",
Other (e.g. Ionic/Cordova, Node, browser, operating system): "@ionic/angular": "^6.0.0" Capacitor 3
How to reproduce these conditions
I am looking into https://github.com/angular/angularfire/blob/master/samples/modular/src/app/database/database.component.ts
and don't see an example of how to query from realtime database.
My older code is
and trying to write something (below is a broken code):
Please advise