假设我有一个看起来像这样的数组
postedAt: 241242
categories:
- gaming: true
- history: true
- sports: true
是否可以创建看起来像这样的 firestore 索引...
类别。*降序:真
或者我是否必须为类别中的每个可能值创建一个索引?
非常感谢您的帮助。
最佳答案
是的。 Use Subcollections .
let data: [String: Any] = [
"postedAt": 241242,
"categories": [
"gaming": true,
"history": true,
"sports": true,
]
]
Firestore.firestore().collection("users/data").addDocument(data)
关于ios - 索引 Firestore 多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49471011/