我正在尝试从firebase检索对象列表。这是数据库的结构:
我试过这个:
this.db.object('/users/'+this.userId+'/movies-favourited/').snapshotChanges().subscribe(data=>{
this.favouriteList = data.payload.val()
});
我从这个查询中得到null。我错过了什么??
p、 这就是我在控制台中获得的数据。有效载荷:
Object { _database: {…}, _delegate: {…} }
_database: Object { _delegate: {…}, app: {…}, INTERNAL: {…} }
INTERNAL: Object { delete: delete()
}
_delegate: Object { _repoInternal: {…}, type: "database", _instanceStarted: true, … }
app: Object { isDeleted_: false, name_: "[DEFAULT]", automaticDataCollectionEnabled_: false, … }
<prototype>: Object { useEmulator: useEmulator(host, port, options), ref: ref(path), refFromURL: refFromURL(url)
, … }
_delegate: Object { _node: {…}, ref: {…}, _index: {} }
_index: Object { }
_node: Object { children_: {…}, priorityNode_: null, indexMap_: {…}, … }
ref: Object { _repo: {…}, _path: {…}, _orderByCalled: false, … }
<prototype>: Object { child: child(path), exists: exists(), exportVal: exportVal()
, … }
<prototype>: Object { val: val(), exportVal: exportVal(), toJSON: toJSON(), … }
暂无答案!
目前还没有任何答案,快来回答吧!