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

Reload a ListView inside a Fragment after press back from Activity
android: volley keeps retrying when receiving 403 code
Increase the height of recyclerview dynamically on item add
Android - PageViewer View stuck on screen
“Unfortunately, application has stopped” for some version of Android
Auto rotate fullscreen video in android
Escaping a Strange Firewall/Firewalking
Gravity of BitmapDrawable doesn't work
Matchmaking with Firebase
How the Web Whatsapp Sends the message?
Realm and the lack of LIMIT: How a to do a stepped delete operation?
Copy shared objects to jniLibs when using cmake for Android
Replace one fragment to another
How to listen to a DialogFragment dismiss event
imageview movement in relative layout
Can and Should we commit SharedPreferences on NON UI thread, if yes how ?

Categories

HOME
url-redirection
eclipse
jmx
spring-data-redis
jquery-ui
nuget-package
trac
pcl-crypto
categorical-data
cmdb
plink
alpacajs
google-content-api
sigma.js
lilypond
breadth-first-search
ag
question2answer
gmock
pic32
bulletphysics
vex
realm-mobile-platform
zend-debugger
record
spring-security4
openwhisk
html-encode
reverse
metawidget
levenshtein-distance
preloader
microsoft-metro
berkeley-db-je
apache-directory
flask-login
vaadin-elements
servermanager
getchar
fwrite
wcftestclient
azure-cli
cup
renaming
gets
slackware
actor-platform
ziparchive
redbeard-ios
myspace
scaffolding
aurora
uiactionsheet
concurrentmodification
opl
tfs-workitem
oracle-spatial
mod-proxy
vacuum
baasbox
botan
grouping-sets
exceldatareader
at-job
showdialog
teaspoon
encryption-asymmetric
unix-socket
personalization
reflector
dot42
terminate
clickbank
mt4j
mysql-error-1044
c++builder-xe5
hidapi
font-awesome-4.0.0
insert-id
josql
agility.js
saxparseexception
ruby-1.8
instantiationexception
easyb
alsb
int64
product-management
appliance

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