0

Firebase - How do I get all objects where companyUid equals companyUid

I'm using typescript with Firebase.

This is my current code that returns nothing:

  • refApp is the "applications"

     var query = this.refApp.orderByChild('companyUid').equalTo(this.uid); 
    

This is my list of applications:

enter image description here

*I'm wanting to loop through all the applicantions and nested applicantions and extract where companyUI = "32b15d97-e6e7-4252-8ae1-262d2a8a51bc"

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
AngularM
  • 15,982
  • 28
  • 94
  • 169
  • You cannot query based on a value in a nested child list with Firebase. See http://stackoverflow.com/questions/27207059/firebase-query-double-nested – Frank van Puffelen Dec 20 '15 at 16:58
  • How do I extract all objects that have the companyUid? – AngularM Dec 20 '15 at 17:28
  • I looked at the other question and still couldnt get it working – AngularM Dec 20 '15 at 17:28
  • Firebase queries don't allow querying your data structure in the way you want. You will need to change your data structure to allow the query. This has been asked many times before and I suggest you start by reading some of [those answers](http://stackoverflow.com/search?q=%5Bfirebase%5D+query+nested) and applying them to your case. If you get stuck there, post what you've tried (please don't post screenshots of JSON text, post the actual JSON text instead). – Frank van Puffelen Dec 20 '15 at 17:40
  • I was just told to implement that structure by someone at firebase google – AngularM Dec 20 '15 at 17:45
  • All 5 questions you asked in the past 24 hours are probably part of the same problem to you, but they're simply 5 different snippets for the people that are trying to help you. StackOverflow is simply not a good medium to teach you NoSQL data modeling or to help you translate requirements one step at a time. You'd do well to read https://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/ – Frank van Puffelen Dec 20 '15 at 18:19

0 Answers0