Firebase 在Firestore中查询对象数组中的子对象
我正在尝试在firestore集合中查找数组字段的元素 这是firestore中的字段:Firebase 在Firestore中查询对象数组中的子对象,firebase,google-cloud-firestore,Firebase,Google Cloud Firestore,我正在尝试在firestore集合中查找数组字段的元素 这是firestore中的字段: channels: [{name: "linkedin", date: "2020-01-02"}] 以下是我尝试查询它的方式: firebase.firestore().collection("users") .where("status", "==", "ACTIVE") .where("channels", "array-contains", { name: "linkedin"
channels: [{name: "linkedin", date: "2020-01-02"}]
以下是我尝试查询它的方式:
firebase.firestore().collection("users")
.where("status", "==", "ACTIVE")
.where("channels", "array-contains", {
name: "linkedin"
})
数组包含
无法对属性的对象特定值执行搜索
如果你做一些像频道:[“Linkedin”、“facebook”、“twitter”]
可能您希望尝试对通道使用子集合,否则,您需要将所有值提取到通道中,然后在内存中应用过滤器