Is orderByChild(x).equalTo(y).limitToFirst(n) running server-side ?

177 views
Skip to first unread message

olivier...@innovorder.fr

unread,
Nov 30, 2016, 10:09:51 AM11/30/16
to Firebase Google Group
Hi Firebase Support,

Is orderByChild(x).equalTo(y).limitToFirst(n)  running on the firebase server-side ?

Let's say I have two Node.js processes listening to a Firebase node "tasks". On each node, I do :
  1. Process1: tasks.orderByChild('_state').equalTo("state_1").limitToFirst(1)
  2. Process2: tasks.orderByChild('_state').equalTo("state_2").limitToFirst(1)
The "tasks "firebase node is going to receive many child nodes with different "_state" values. I'd like to know if each Node.js process will receive all events or just the one with the corresponding "_state" value as defined by the orderByChild().equalTo() ? (server-side VS client-side)

Thank you very much in advance,

Kind regards, 

Jacob Wenger

unread,
Nov 30, 2016, 10:52:28 AM11/30/16
to fireba...@googlegroups.com
Hey Olivier,

Firebase can actually do both. By default, the Firebase clients can perform ad-hoc queries on the client-side. This is to ease development and to make sure things work out-of-the-box. However, we strongly suggest that you index your data using .indexOn rules to get server-side filtering. This will be critical as your app goes to production and starts to grow. See Index Your Data for the full details, including some examples.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/9f86a0f0-3940-478c-9bd8-49cde74d033a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages