Firebase database design for use in App Inventor

I find working with a NOSQL like Firebase quite a challenge. It is almost impossible to search the Db with wildcards (if there is, then please share the code blocks). Even searching by (say) date periods, or certain tags is quite a mystery (unline SQL Dbs where one sql statement solves most issues). That's the reason why I really have to think deeply about the Db design before writing most of the front end code. So here are a few questions I that I have.

  1. Can we connect to fireDb and download records based on part values in a field? For example ' download all records where the 'Unique ID' is like "ABc" where this field could contain data like "123ABc456" or "ASDF12345" or "ABC34322skk" or SD23ABc667584", etc?
  2. How do we search FireDb multiple hierarchies deep and extract only certain records? For example, say, we have a branch like 'Home>>UserID', under each 'UserID' branch we have (say) 10 fields and we wish to extract all userIDs but with only (say) 6 fields (out of the 10) from each record.
  3. How do we connect to MySQL from MIT App Inventor and issue SQL statements? Please advise with sample blocks, if possible. (My backup plan)

Thank you, in advance

1 & 2 You probably need to use the REST API for Firebase using the web component, and do some work on Firebase to set indexes

https://firebase.google.com/docs/reference/rest/database
https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-ordered-data

3

1 Like

Thank you for the quick reply. Will go through your links and revert, if still in confusion.