google-cloud-firestore

Firestore Query Properties with special characters

和自甴很熟 提交于 2021-02-16 14:24:04
问题 I've a collection with contacts with a structure like: name: 'XPTO' emails: { susan@xpto.com: 'Susan', fred@xpto.com: 'Fred' } But the query will not return result: db.firestore().collection('contacts').where('emails.susan@xpto.com', '==', 'Susan').get().then(... Because of the dot at "susan@xpto.com" How to escape the dot? I've tried `` and [ ] and didn't work. 回答1: The documentation that suggests you should escape fields using backticks is actually not correct. It's in the process of being

How can I order the documents in Firestore?

◇◆丶佛笑我妖孽 提交于 2021-02-16 14:19:33
问题 How can I order the documents in Firestore? It looks like Firestore lists documents in alphabetic order by the ID I let Firestore automatically create. But I don't want that. I just want to see my newly added document added as the last document in the collection. How do I do that? Should I create my own alphabetic ID's? Example of my collection in Firestore: 回答1: Firestore is meant to scale massively. At that scale, it doesn't matter what order the documents appear in the console, because the

Filter location GeoPoint in distance radius - Firestore

房东的猫 提交于 2021-02-16 14:10:42
问题 How to search the Firestore database for the location Latitude and Longitude within a defined distance radius. Sample Database: COMPANIES - COMPANY 1 --Lat: 12345 --Long: 6789 - COMPANY 2 --Lat: 457851 --Long: 654214 - COMPANY 3 --Lat: 12345 --Long: 6789 - COMPANY 4 --Lat: 12463 --Long: 65487 Note: At Real Time I had the option to use GeoFire, but at Firestore I did not find any way. How could you go through the database and find the Companies according to your Location, within a radius of

Filter location GeoPoint in distance radius - Firestore

老子叫甜甜 提交于 2021-02-16 14:10:13
问题 How to search the Firestore database for the location Latitude and Longitude within a defined distance radius. Sample Database: COMPANIES - COMPANY 1 --Lat: 12345 --Long: 6789 - COMPANY 2 --Lat: 457851 --Long: 654214 - COMPANY 3 --Lat: 12345 --Long: 6789 - COMPANY 4 --Lat: 12463 --Long: 65487 Note: At Real Time I had the option to use GeoFire, but at Firestore I did not find any way. How could you go through the database and find the Companies according to your Location, within a radius of

How to avoid loops when writing cloud functions?

两盒软妹~` 提交于 2021-02-16 13:36:49
问题 When writing event based cloud functions for firebase firestore it's common to update fields in the affected document, for example: When a document of users collection is updated a function will trigger, let's say we want to determine the user info state and we have a completeInfo: boolean property, the function will have to perform another update so that the trigger will fire again, if we don't use a flag like needsUpdate: boolean to determine if excecuting the function we will have an

How to avoid loops when writing cloud functions?

给你一囗甜甜゛ 提交于 2021-02-16 13:33:15
问题 When writing event based cloud functions for firebase firestore it's common to update fields in the affected document, for example: When a document of users collection is updated a function will trigger, let's say we want to determine the user info state and we have a completeInfo: boolean property, the function will have to perform another update so that the trigger will fire again, if we don't use a flag like needsUpdate: boolean to determine if excecuting the function we will have an

I want to delete the array stored in Firestore

非 Y 不嫁゛ 提交于 2021-02-15 07:34:22
问题 I received the user's email and designated it as the name of the document, and stored the user information in the document in an array. I tried running my code, but only the Toast message is executed, not deleted. I have listed the arrays as a list using RecyclerView . Deletion will be implemented through showPop() method. This is my Firestore database enter image description here I want to delete index-0 private void showPopup(View v,final int position) { PopupMenu popup = new PopupMenu

Deleting Firestore Data in Flutter List View

烈酒焚心 提交于 2021-02-15 07:32:15
问题 I have a regular List View that fetches some data from Firestore, here is the code for it: body: StreamBuilder( stream: FirebaseFirestore.instance.collection('orders').snapshots(), builder: (context, snapshot) { if (!snapshot.hasData) return Center( child: CircularProgressIndicator(), ); return ListView.builder( itemCount: snapshot.data.docs.length, itemBuilder: (context, index) { DocumentSnapshot ds = snapshot.data.docs[index]; return Text(ds['name']); Now if I wanted to create a delete

MongoDB and Google Cloud Functions VPC Peering?

非 Y 不嫁゛ 提交于 2021-02-13 17:33:23
问题 I've having issues accessing MongoDB Atlas from Google Cloud functions. It is giving me error regarding IP Whitelisting but I've added both (Serverless VPC Access) IP address range and VPC Network Peering IP address range to MongoDB whitelist. I've also created MongoDB peering with google cloud. If I allow (access from anywhere) then my mongodb starts working fine, otherwise it gives error regarding IP whitelisting. I'm not sure what else I should add to MongoDB whitelist when I've added both

MongoDB and Google Cloud Functions VPC Peering?

ぐ巨炮叔叔 提交于 2021-02-13 17:33:21
问题 I've having issues accessing MongoDB Atlas from Google Cloud functions. It is giving me error regarding IP Whitelisting but I've added both (Serverless VPC Access) IP address range and VPC Network Peering IP address range to MongoDB whitelist. I've also created MongoDB peering with google cloud. If I allow (access from anywhere) then my mongodb starts working fine, otherwise it gives error regarding IP whitelisting. I'm not sure what else I should add to MongoDB whitelist when I've added both