您好,我试图通过各种查询搜索拉取多个对象,但我想知道如何在不产生多个“ orderBy”入口点和等于入口点的情况下做到这一点。
这是我的数据
{
Item: {
IDNumber1: {
productDepartment: Cullinary,
productStore: JCPenny
}
IDNumber2: {
productDepartment: Cullinary,
productStore: Macys
}
IDNumber3: {
productDepartment: Home,
productStore: JCPenny
}
IDNumber4: {
productDepartment: Ties,
productStore: JCPenny
}
IDNumber5: {
productDepartment: Cullinary,
productStore: Macys
}
IDNumber6: {
productDepartment: Cullinary,
productStore: Dillards
}
IDNumber7: {
productDepartment: Ties,
productStore: Dillards
}
}
}
如果我想拉出所有包含梅西百货公司领带和迪拉德百货公司的对象,那么不同的对象在这种情况下为productStore和productDepartment 我想知道如何对各种Item名称进行OrderByChild并将其等于我要提取的数据。
const query = dataFirebase.ref("jobs");
query.orderByChild('productName').equalTo('Home').on('child_added', function(snapshot) {
var test = snapshot.val();
console.log(test)
}
我想知道使用
这样的东西是否是一个好主意 const query = dataFirebase.ref("jobs");
query.orderByChild('productName','productDepartment').equalTo('Home','Dillards').on('child_added', function(snapshot) {
var test = snapshot.val();
console.log(test)
}