About elements
Last updated
Last updated
The plugin firebase and firestore elements are bunches of code that get added to the page when you position them on it. The elements will be invisible to the user, but keep in mind they can mess with your UI. To avoid it, you can set the width and height to 0px.
The actions performed by the elements are run when they are loaded to the page, so you can control when they run the first type using the visibility settings.
Each element stores a various states that will contain your data and allow for a variety of filters and settings to best suit your need.
Get information on the current user authenticated using the Firebase Authentication service.
Performs a query to get a list of documents from a Firestore collection.
Convert latitude and longitude into a geohash for you to store on a document. This is required to perform geoqueries, in which you sort data from geolocation.
A JSON reader, that helps you to get data from fields on document data returned by queries.
Performs a query to get a single document from a Firestore collection.
Performs an aggregation query (count, sum or average) in a Firestore collection.
Gets a list of documents or an array of JSONs and allows to filter and sort them on the front-end, without making new queries to Firestore.
Allows to upload files to Firebase Storage.
Helps to display entire documents on Bubble's Dropdown elements, by choosing which field to display.
Keep in mind that, because the query operations run on the front-end, Bubble sometimes messes with the order in which data arrives from Firestore. That means you must account that factor while using results of other Firebase elements as input data in other query elements.
For instance, if you want to get documents form the "tasks" collection where the "owner" filter equals the current user's document reference, you can use the filter bellow (owner == users/Firebase Auth's User ID).
But if the User ID is not yet available, the query will fail due to security rules on Firestore.
To work around that, you can put a visibility conditional on the Firestore Data element, for it to show only when the User ID is not empty. As the query will only occur when the element is "visible" on the page, it will wait for when the User ID is available to run the query, avoiding the error.
Keep that in mind when fetching data from Firestore.