firestation icon indicating copy to clipboard operation
firestation copied to clipboard

Filter by a nested "keys"?

Open Whyser opened this issue 6 years ago • 3 comments

Hey, thanks for this great visualization tool.

Sorry if this is a stupid question but, I'd like to query by a unknown "key". I have the following structure (not my actual use-case).

{
   'users':
   {
      '7894hut988g3':
      {
         'username': 'jack'
      }
      'jhbsfbhsfa989':
      {
         'username': 'jimbo'
         'friends':
         {
             'bfhbsjfs87878':
             {
                'username':'jack'
             }
         }
      }
   }
}

And I would like to do something like: select * from users.$.friends.$.username = 'jack' Where $ is it's unknown value/key. Right now I can only get: select * from users where friends != null to work

Whyser avatar Oct 23 '18 15:10 Whyser

I don't think this is supported at the moment, but I can't totally remember. Sorry, I haven't worked on this project in a while.

You could try something like: select * from (select friends from users) where username = 'jack';

I think I have that type of nested query working on the projectRevamp branch. You could follow the instructions to launch that locally from that link and give it a shot. Good luck!

JoeRoddy avatar Oct 25 '18 13:10 JoeRoddy

Thanks Joe, I will try it out later! In-case you know off the bat, do you think this is available for Fire base (noticed that the new topic talks alot about Fire store)?

EDIT: Didn't seem to work, it doesn't recognize the nested query. It thinks that the table is named select and looks into that.

Whyser avatar Oct 26 '18 09:10 Whyser

Ah, okay, sorry! The next time I work on this I'll see if I can get a query like that working.

JoeRoddy avatar Oct 26 '18 19:10 JoeRoddy