android


Querying with two criteria in Firebase on Android


I have a sharded dataset like the example below where every month a new shard is created with vote counts recorded on posts. (This isn't exactly the data I'm using but representative of the structure I need)
{
"votes" : {
"201604" : {
"First Post" : {
"count" : 1,
"label" : "First Post"
},
"Second Post" : {
"count" : 3,
"label" : "Second Post"
},
"Third Post" : {
"count" : 1,
"label" : "Third Post"
}
}
"201605" : {
"First Post" : {
"count" : 5,
"label" : "First Post"
},
"Second Post" : {
"count" : 3,
"label" : "Second Post"
},
"Third Post" : {
"count" : 2,
"label" : "Third Post"
}
}
}
}
What I need to do is return the top X Posts by Count for the last Y shards (descending)
This query doesn't work as I can't combine multiple orderBy clauses but in my mind is explaining what I'm trying to achieve;
database.child("votes").limitToLast(2).orderByValue().orderByChild("count").limitToFirst(10);

Related Links

Android 2D Game advice
How to read the gold price from the given link
Android: Default Bitmap density when saving and loading from Internal Storage
Localize strings returned by a web service
How to modify the database values through user interface?
How to navigate from one view to another view like iphone inside tab bar - Android apps
How set backgrond imagebellow the openGL Rendering Particle?
getting errors while configuring android on ubuntu 11.10
OutOfMemory when decoding image from url
adding view with delay
simple TCP server-client using two Android emulators [closed]
Cache color hint to transparent doesn't remove fade effect
Android solving compatibility with SDK_INT hack; is this ok?
Slide Unlocker ImageView [duplicate]
URL with parameter in WebView not working in Android?
How to pause Video Player?

Categories

HOME
windows
notepad++
android-studio-2.2
powerpoint
mstest
jelastic
pclxl
vscode-extensions
ms-access-2016
aws-cli
simulink
ado.net
interpolation
hpc
joomla3.0
mel
activecollab
mxgraph
opengl-es-3.0
tput
esoteric-languages
standards
git-extensions
boost-icl
google-maps-autocomplete
r-mice
exit
resourcebundle
comparator
windows-server-2003
tiki-wiki
corpus
datastax-enterprise-graph
subclass
userdefaults
utorrent
openwhisk
arduino-ide
raft
imagenet
z-notation
bc
odroid
diacritics
linq-to-objects
unordered-map
postgresql-8.4
clang++
double-click
flask-restful
dotnet-httpclient
identification
java-6
truezip
filehandle
structuremap4
sandcastle
builtins
parfor
windows-azure-queues
tooleap
cifilter
observablecollection
qiime
kango-framework
data-protection
project-organization
dbamp
turbo-prolog
redis-cluster
directdraw
toran-proxy
flock
intel-c++
amiga
pyobjc
fail2ban
cakephp-2.7
exceldatareader
nodelist
angular-gettext
deform
contrast
punycode
rmysql
jama
trdion2011
jqmodal
codeplex
mintty
live555
notorm
mysql-error-1044
cffile
pclzip
web-farm
pyunit
failing-tests
agility.js
catransform3d
xcelsius
massive
undefined-index
uideviceorientation
jqueryform
folding
mathematical-notation
fault-tolerance
lemmatization
leader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App