[new plugin] Firebase Auth & Firestore

Hi,

I am trying to query a list of documents using the Data List element. I am using the firebase query to check if the id is in an array of ids.
However, the Data List element ignores this query and just loads the entire list of documents which is huge. I have even tried using the front en


Hey @Panto9, two things that probably are causing the issue.

  1. The operator you want to use in this case is “in” and not “array-contains”. Also, be sure to provide the list as a javascript array, in the format [“text1”,“text2”,“text3”]
  2. Since you’re using another query’s value as the filter value, you must wait until it’s ready. You can do this by hiding+collapsing the Data List element and setting a conditional to show it only when the Data Single “field1 (list)” count is > 0. (documentation reference)

Check to see if that works.

1 Like

HI Augusto,

Quick question. (It’s the previous guy, just moved the project to a new account😊)

I have an array of objects (map) in the database. How do I specify this type of field in the actions (for clearing this array, adding a new object to the array, or removing an object from the array)?

Hey @digiitsagency, to manage lists of maps, you can use de “action types”:

  • list add map
  • list remove map

See more on the Field Types documentation => Field types table | Firebase Auth, Firestore & Storage (plugin)

2 Likes

Hello, I’m curious.

I will soon be implementing search feature in my app. I want some basic search where I can match the keywords to the product name. However, the query filters don’t have any of the filter type I’m looking for (unless it’s a different interpretation or method to achieve this in firebase).

Is it possible to search database based on keywords and return collections whose specified field contains any of the letters in the search keyword? Either randomly, respecting caps or in the character order of appearance in the key

Hey @digiitsagency. Firebase Firestore doens’t support this kind of queries. So filter like “text field contains x” are not possible. Usually what is done is to integrate with Algolia and create Cloud Functions that feed the collection data you want to apply these kind of query on to an Algolia Index.

1 Like

Ok, thanks

Hello Augusto,
Hope you’re doing good. Your plugin has been a Godsend since I discovered it. Despite the small bugs here and there I am quiet satisfied with it and it helps me during this time where I am not really making any money from Bubble and just doing free projects, thereby keeping costs to a minimum. Thanks a lot.

Please could you put me through on how to create or update a map or a list of maps using the plugin? Here I’d like to save the user’s subscription along with other data like the date they first subscribed, the renewal amount and dates, the date they last subscribed etc…

I want to be able to save this as an object in an array (list of subscriptions) in the user’s documents.

So basically I want this: :point_down:t6:

to be here as a list of maps/objects (for all fields except the transaction link - that’ll go ti it’s seperate array)

That way I save document reads and simply load all this at once when the user accesses their account.

I’m also trying to figure out how to upload a file to storage and get the URL to be saved in a document. And also be a lento download said file either directly from the link saved in the document or some other appropriate method.

I figured out the file upload part. I was confused about all the base64 terminology. Just had to quickly read up on it to understand a little. Please correct me if there’s a better process by which I can achieve this same result.

Steps::

  1. first get the File URL to Base64 plugin by blur apps

  1. add the plugin element to the page and point it to the file you want to upload. Usually the file uploader elements value. Remember to setup a way to know or notify you when the file has been converted to base64. I simply had a text element showing the value (truncated of course). You could use some alert or more advanced conditionals or workflows [like making the button only clickable/visible when the FileBase64" element’s base64 value is not empty].

  1. add “firebase storage file upload base64” action to your preferred trigger

Screenshot 2024-05-15 223907

4.a. setup the “File Base64 string” to point to the “FiletoBase64” element’s “File Base64”.

4.b.Note that this will only be valid for “File String Type” of “base64”.
If you choose a “File String Type” of “data_url”, then set the “File Base64 string” on the “firebase storage file upload base64” action to the “FileBase64” → “full base64 string”

  1. set the “folder path” to something relevant like the category of files your uploading. It’s essentially the folder name for the file’s location on Firebase storage. In the images above I set mine to “newsletters”

  2. set the trigger ID to anything, this will be used for the action listener that’ll get the uploaded file’s URL. I used “file” in the example above

  3. add the firebase action listener and connect it to the “firebase storage file upload base64” action with the same trigger ID

  1. Setup the “firebase document creation” action within the trigger for the action listener,

9.a. Setup the action listener to save the uploaded file url to a custom state somewhere on the page. This is optional, if you want it available outside the action listener for other things.

9.b. You can now use the saved link in the custom state or use the url directly from the action listener.

And hey presto! the file was uploaded to Firestore, and you can use the link for whatever else you want either by directly setting an action inside the action listener or saving it to a custom state (still within the action listener)

file upload demo