- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正尝试在我的 Android 应用程序中执行 orderByChild
操作,我收到这样的警告:使用未指定的索引。考虑在 users/4Gc9OgFWw5hwr2YFxbfwLgyAp1V2/posts 添加 '".indexOn": "timestamp"' 到您的安全和 Firebase 数据库规则
这就是我构建数据库的方式:
这是我试图添加到我的数据库中的规则:
{
"rules": {
".read": "auth != null",
".write": "auth != null",
"users": {
"uid": {
"posts": {
".indexOn": "timestamp"
}
}
}
}
}
但是,它仍然给我这个警告。我该如何解决?我在某处看到您可以为 uid 子级使用任何变量,这就是为什么我在那里有 uid
变量,但我也尝试过不使用它。
最佳答案
在你的规则中应该是$uid
而不是uid
结帐this
{
"rules":{
".read":"auth != null",
".write":"auth != null",
"users":{
"$uid":{
"posts":{
".indexOn":"timestamp"
}
}
}
}
}
关于android - 在时间戳 Firebase 上建立索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48311444/
给定一个带有多个 date_time 戳的字符串,我想 提取第一个戳及其前面的文本 候选字符串可以有一个或多个时间戳 后续的 date_time 戳记将被 sep="-" 隔开 后续date_time
是否可以合并从相机拍摄的文本和照片?我想在照片上标记日期和时间,但我在 Google 上找不到任何内容。 最佳答案 使用下面的代码来实现你所需要的。 Bitmap src = Bitm
有没有办法通过 Graph API 戳另一个用户?基于this post ,并使用 Graph Explorer ,我发布到“/USERID/pokes”,我已经授予它(Graph API 应用程序和
我有两个向左浮动的元素。一个是 body 的第一个 child ,另一个是容器的第一个 child ,容器是 body 的第二个 child 。 ...
我是一名优秀的程序员,十分优秀!