我有一个项目,我需要显示前20名的排行榜,如果用户不在排行榜,他们将出现在他们当前排名的第21位.
有效的方法吗?
我使用Cloud Firestore作为数据库.我认为选择它而不是MongoDB是错误的,但我在项目的中间,所以我必须使用Cloud Firestore.
该应用程序将由30K用户使用.没有获得所有30k用户,有没有办法做到这一点?
this.authProvider.afs.collection('profiles', ref => ref.where('status', '==', 1)
.where('point', '>', 0)
.orderBy('point', 'desc').limit(20))
Run Code Online (Sandbox Code Playgroud)
这是我为获得前20名所做的代码,但如果他们不在前20名,那么获得当前登录用户排名的最佳做法是什么?
javascript database firebase angularfire2 google-cloud-firestore
我brew cask install android-idk在Mac OS X上安装android sdk()时遇到问题.我尝试将其安装为nativescript.我读过那些遇到同样问题但找不到工作解决方案的人.我试图改变java路径可能会导致问题.
这是我得到的错误:
==> Caveats
We will install android-sdk-tools, platform-tools, and build-tools for you.
You can control android sdk packages via the sdkmanager command.
You may want to add to your profile:
'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk'
This operation may take up to 10 minutes depending on your internet connection.
Please, be patient.
==> Satisfying dependencies
==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
Already downloaded: /Users/jhon/Library/Caches/Homebrew/Cask/android-sdk--3859397,26.0.1.zip
==> Verifying checksum for Cask android-sdk
==> Installing Cask android-sdk
==> Warning: Failed to …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用firestore实现多查询和分页,但是一旦我将<或>添加到查询中,光标就无法正常工作.
//working example:
the doc id i save as propery on the doc
ref.where('category','==' 'cats').where('status', '==', 1).orderBy('id').cursor('last doc id from the returned list').limit(3)
//not working exmple:
ref.where('category','==' 'cats').where('status', '==', 1).orderBy('price').where('price', '>=', 2).where('price', '<=', 55).orderBy('id').cursor('last doc id from the returned list').limit(3)
Run Code Online (Sandbox Code Playgroud)
没有错误返回.是firestore还是我的错误?