我正在尝试从 firebase 节点获取单个密钥,但无法从我现在拥有的代码中获取任何密钥。这是我的代码:
let app = Firebase.initializeApp(config)
let db = app.database()
let bdRef = db.ref()
export default {
name: 'hello',
firebase: {
businesses: bdRef.orderByChild('.key').equalTo('306')
}
}
执行此操作时出现此错误:
validation.js?5c80:234 未捕获错误:Query.orderByChild 失败:第一个参数是无效路径 =“.key”。路径必须是非空字符串,并且不能包含“.”、“#”、“$”、“[”或“]”`
当我使用我的代码执行此操作时:
businesses: bdRef.orderByChild('title').equalTo('Feather Animation Wood Carving Supplies')
它带有这个数组:
0:Object
.key:"3021"
address:"Hello Avenue"
city:""
description:"Wood carving tools and supplies. Please contact us by phone or internet."
email:"hi@gmail.com"
employees:"1"
我如何获得.key
财产?