google-cloud-firestore

Clear Firestore database of all data?

大兔子大兔子 提交于 2021-02-20 06:03:33
问题 After over a year of development, I have a pretty well developed site. Now I'm going to open it up for a public beta but I need to clear my Firestore of all it's data (it's all test data). Is there a simple way to do this or do I have to delete every single entry by hand? (There are over 1000 entries). The only realistic option I can think of at the moment is to switch Firebase projects to a new one, which is not something I want to do. Solution : After reaching out to Firebase support, I was

Clear Firestore database of all data?

天大地大妈咪最大 提交于 2021-02-20 06:02:56
问题 After over a year of development, I have a pretty well developed site. Now I'm going to open it up for a public beta but I need to clear my Firestore of all it's data (it's all test data). Is there a simple way to do this or do I have to delete every single entry by hand? (There are over 1000 entries). The only realistic option I can think of at the moment is to switch Firebase projects to a new one, which is not something I want to do. Solution : After reaching out to Firebase support, I was

Is it possible to query Field and get main collection field and get sub collection with sub collection documents on cloud firestore?

无人久伴 提交于 2021-02-20 03:51:27
问题 I need to query fields and get all sub-collections and fields. Is it possible? Stream<List<ChatFieldModel>> getChatField(String uid) { var ref = _db.collection('chats') .where('toUserId', isEqualTo: uid); //Afterthat need to get sub collection with sub collection list of documents and main collection fields value. is it possible? return ref.snapshots().map((list) => list.documents .map((doc) => ChatFieldModel.fromForestore(doc)) .toList()); } 回答1: Firestore queries are shallow. They only

Is it possible to query Field and get main collection field and get sub collection with sub collection documents on cloud firestore?

為{幸葍}努か 提交于 2021-02-20 03:51:22
问题 I need to query fields and get all sub-collections and fields. Is it possible? Stream<List<ChatFieldModel>> getChatField(String uid) { var ref = _db.collection('chats') .where('toUserId', isEqualTo: uid); //Afterthat need to get sub collection with sub collection list of documents and main collection fields value. is it possible? return ref.snapshots().map((list) => list.documents .map((doc) => ChatFieldModel.fromForestore(doc)) .toList()); } 回答1: Firestore queries are shallow. They only

Best Way to Use Business Logic Across Multiple Platforms (Cloud Functions?)

拥有回忆 提交于 2021-02-20 03:50:42
问题 I am in the process of creating a mobile and web version of an app using ReactJS and iOS respectively. Both of these platforms will pull data down from a Firestore database to use but I am wondering what is the best way to only write business logic once in order to do operations on the database? For instance, on both apps you will click a button that updates a field in the Firestore database, instead of writing the logic to do this in Javascript and then Swift, is there a best practice to

How to get data from a map (object) Cloud Firestore document on Swift 4.2?

偶尔善良 提交于 2021-02-19 09:11:01
问题 I am using Cloud Firestore as a Database for my iOS App. I have an issue while I want to query my data when the document contains Maps (Object Type). I can not access the fields (say: firstName here) of a map (nameOnId) by having the simple query. My code is as bellow: let db = Firestore.firestore() db.collection("userDetails").getDocuments() { (querySnapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in querySnapshot!.documents { let results =

How to get data from a map (object) Cloud Firestore document on Swift 4.2?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-19 09:09:22
问题 I am using Cloud Firestore as a Database for my iOS App. I have an issue while I want to query my data when the document contains Maps (Object Type). I can not access the fields (say: firstName here) of a map (nameOnId) by having the simple query. My code is as bellow: let db = Firestore.firestore() db.collection("userDetails").getDocuments() { (querySnapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in querySnapshot!.documents { let results =

How to get data from a map (object) Cloud Firestore document on Swift 4.2?

偶尔善良 提交于 2021-02-19 09:06:56
问题 I am using Cloud Firestore as a Database for my iOS App. I have an issue while I want to query my data when the document contains Maps (Object Type). I can not access the fields (say: firstName here) of a map (nameOnId) by having the simple query. My code is as bellow: let db = Firestore.firestore() db.collection("userDetails").getDocuments() { (querySnapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in querySnapshot!.documents { let results =

user access and data control to cloud firestore when calls to firestore are made server side

假如想象 提交于 2021-02-19 08:45:38
问题 I've started a web-based project using nodejs, express, firebase functions, firestore and eventually want to use firebase hosting. So far, I have been able to keep everything server side until I've reached Authorisation and Authentication. I'm using a model view controller structure so calls to firestore are being made server side and therefore the firestore security rules don't work. Firestore security rules only work if you access firestore client side. Can I use google cloud IAM (Identity

Use firestore's FieldPath.documentId() in within nested object

眉间皱痕 提交于 2021-02-19 08:03:05
问题 This is how my data is structured: So an element has a cluster object and the cluster object has a tags object with one or more tag objects. This is inline with firebase's denormalized data structure Explained here. (We use multi path updates and lookup tables to keep data consistent, this means tags cant be an array!) I would like to query on the document id's of the nested tags object. I know that firestore.FieldPath.documentId() returns the document id and one can use it in a query like so