How to list all the single field indexes in Firestore? - google-cloud-firestore

Recently, I started to create single field exemptions to reduce the Firestore storage for my project.
It works as expected, but I want to see all automatically created indexes. Is there any way?

I quickly checked the Firestore console (both in Firebase and Google Cloud) and don't see a list of the automatically created single-field indexes there.
Even the REST API and the gcloud CLI seem to only show the exemptions, just like the console does.
So as far as I can tell, there is no way to get a list of all indexes.

Related

Create a database entry for the UID after sign up with firebase and swift

I’m developing an app in swift by using firebase in the back end.
I have successfully created a user by using the standard procedure as stated in the documentation.
My problem comes when I want to add the UID value to the database. I can’t. What I’m doing is getting the UID (userID) from the Auth().user (what I successfully do) and using the following code (I don’t have de computer do it can contain errors but I copy it from the documentation and I’m fact it compiles, the problem is that is does nothing
let ref = Database().database().reference()
self.ref.child(“users”).setValue(userID)
I have tried with the following
Self.ref.child(“users”).child(user.id).setValue(userID)
But it fails due to the fact that users have no children. The issue is that users is a collection and I don’t now if it works in the same way or not.
My intentions is to create the entry in the “users” collection in the database just after singing up a new user. (And to be able to layer erase it)
Thanks!
Firebase has two NoSQL databases:
the Realtime Database, which is the original JSON database.
Cloud Firestore, which is the newer document/collection database.
These two databases are both part of Firebase, but have completely separate APIs.
You speak about collections in your question, which are a Cloud Firestore concept. But your code uses the API of the Realtime Database. If you're looking to write data to Cloud Firestore, you'll want to use the API that is documented here.

How do I load a Google Cloud Storage Firebase export into BigQuery?

I have a simple, single collection in Firestore, a museum visitor name and date with some other fields.
I successfully ran a gcloud export:
gcloud beta firestore export gs://climatemuseumexhibition2019gov.appspot.com --collection-ids=visitors
and the collection is now sitting in a bucket in Cloud Storage.
I tried downloading the data, which appears to be in several chunks, but it's in .dms format and I have no idea what that is.
Also, I've successfully linked BigQuery to my firestore project but don't see the collection, and I don't see the Cloud Storage object at all.
I gather the idea is create a Dataset from the Cloud Storage, then create a Table from the dataset. I'd appreciate specific details on how to do that.
I've read the manuals and they are opaque on this topic, so I'd appreciate some first hand experience. Thank you.

Using Mongo Stitch with Firebase Storage?

I'm currently developing a solution that lets users create a parent listing whereby they can upload files, assign child listings to that and then search their listings based on data from both the parent and child listings.
As an example, think of it as an inventory database. You create your parent listing for say a product, give it a name and upload some images of it. You then create your child listings which would be the stores that stock your product.
Your search capabilities would allow the user to search the product by free text, but also using parameters from the child listings, for example Price, In Stock, Tags etc.
I've tried to develop a concept using Firebase for this which utilises Auth, Storage and Functions, however due to the search limitations of Firestore, it cannot be done.
MongoDB offers something similar to Firebase' functionality whereby I can use Atlas which gives me all the search capabilities I need using Mongo instead of Firestore. In addition, they also have Stitch which provides the Cloud Function, Trigger and Auth functionality I need.
What they don't offer however is any Storage solution.
Does anyone know a way I can use MongoDB Stitch Auth, alongside Firebase Storage to integrate directly with the UI using the Firebase Storage security rules?
I know I could create a Stitch Function that handles the passing of file from UI to Firebase, however I'd prefer to go direct if possible.

is there a in built feature in firebase to compose forms to make entries to the database

I have a firebase database where I am storing records. Is there anything already existing features in firebase by which I can use/compose a form to make entries to the database?
The Firebase console has a panel where you can see and manipulate the data in your Firebase Database. But beyond that, there is no functionality in the SDKs to help you build edit forms.

firebase queries and swift

I have a string for eg: "My name is John" stored in Firebase.
How would I query firebase so I can find all the posts in Firebase that have "John" ?
I can search for the first term in a string now using:
DataService.dataService.BASE_REF.child("Posts").child(selectedComment.commentKey).queryOrderedByChild("userComment").queryStartingAtValue(comment).queryEndingAtValue(comment+"\u{F8FF}").observeSingleEventOfType(.Value, withBlock: { (snapshot) in
where comment = "My"
I read about using Elastic search with Firebase but wanted to check if there was an easier way in Firebase before I looked at ElasticSearch/Flashlight for Firebase,
Unfortunately, Firebase doesn't support searching thru content like that (in any language SDK). From a Google Groups Post in July '16:
As a company that understands search, we're also a company that
understands using the best tool for the job. For fuzzy matching and
contains, a NoSQL, realtime data store isn't the correct tool--these
queries would be slow and scale poorly. BigQuery or ElasticSearch are
the right tool for providing useful results in a scalable and robust
manner.
Right now, this involves deploying a small node script to sync your
search results with the realtime data, as explained in the article
with the sample Flashlight lib. In the future, it will become more
"effortless" as we add integrations between Firebase and Cloud
products, particularly Cloud Functions and BigQuery interoperability.
BigQuery is, as I understand it, not specifically designed for user-facing search.
Elasticsearch (specifically, the Firebase plugin Flashlight) is a potential solution, but as you alluded to, it's an incredible amount of overhead (deploying/managing or renting an ES cluster, configuring the plugin, etc.). If content search is an important enough part of your app to justify that time/$, you may want to consider solutions beyond Firebase for your database needs, as it's by far one of the service's weakest areas.
In my opinion, you have a few options beyond Flashlight:
Algolia, a Search-as-a-service provider, does offer integration with Firebase, but I've never used it & so can't offer much more than to say that it exists.
Another alternative might be maintaining a collection of documents you want to search on another service, like AWS Cloud Search
Depending on the stage of your project & your needs, consider other Backends-as-a-Service that support more in terms of querying. E.g., GraphQL-as-a-service backends, like Scaphold.io, Graph.cool, and Reindex are all built on SQL databases, and (I believe) all support multiple types of querying.