google-cloud-firestore

Extracting a large number (about 300) documents from a firebase firestore db collection

折月煮酒 提交于 2020-04-17 22:10:15
问题 I am trying to get data from firestore. The code is working fine in FutureBuilder ListView .I tried printing all the entries to console. The code below is working fine but only printing first 10 or so entries. Future getP() async { var firestore = Firestore.instance; var q = await firestore.collection('place_list').getDocuments(); List<Map<String, dynamic>> list = q.documents.map((DocumentSnapshot doc) { return doc.data; }).toList(); print(list); return q.documents; } I want to get all 300

Why I cant query sub-collection or a document from a sub-collection in Firebase?

不问归期 提交于 2020-04-17 21:25:32
问题 I have this query where I am trying to get a document from a sub-collection but it doesnt get anything, neither it shows any error: const db = firebase.firestore(9; let ref = db.collection('myCollection').doc('EzGNfNl63LQvjdauFWosG08Ishj2').collection('privat').doc('privat'); ref.get() .then(doc => { //it doesnt continue to next line, just executes this one if (doc.exists) { console.log("Doc exists:", doc.data()) }else{ console.log("Doc deostn exists:") } }).catch(error => { console.log(

Is there an alternative to writeFields?

不问归期 提交于 2020-04-17 20:04:39
问题 This article stated that "[writeFields] is now deprecated". Additionally, I cannot find any documentation for writeFields , it is not even listed as part of Request in the documentation anymore. Problem The problem I am facing with Cloud Firestore Security Rules is that verifying that only particular fields are modified requires massive amounts of conditions. For example, if I want to verify that the only modified value of a document is cakes , I have to write the following rule: allow update

Is there an alternative to writeFields?

穿精又带淫゛_ 提交于 2020-04-17 20:04:33
问题 This article stated that "[writeFields] is now deprecated". Additionally, I cannot find any documentation for writeFields , it is not even listed as part of Request in the documentation anymore. Problem The problem I am facing with Cloud Firestore Security Rules is that verifying that only particular fields are modified requires massive amounts of conditions. For example, if I want to verify that the only modified value of a document is cakes , I have to write the following rule: allow update

All members pages generated with Mustache have the same data informations of a single member

梦想与她 提交于 2020-04-17 18:48:21
问题 I want to generate member pages with Mustache, based on Data from Firebase. Right now, I am able to generate a page for one member, but all other members have the same informations than this member... Let say I have 4 members, I should be able to have 4 different pages, but right now, only one can be found (one of the members... maybe the last document of the collection or the first document of the collection. ) Any ideas of what I should change? Here is my javascript script: The first part

All members pages generated with Mustache have the same data informations of a single member

徘徊边缘 提交于 2020-04-17 18:46:00
问题 I want to generate member pages with Mustache, based on Data from Firebase. Right now, I am able to generate a page for one member, but all other members have the same informations than this member... Let say I have 4 members, I should be able to have 4 different pages, but right now, only one can be found (one of the members... maybe the last document of the collection or the first document of the collection. ) Any ideas of what I should change? Here is my javascript script: The first part

All members pages generated with Mustache have the same data informations of a single member

帅比萌擦擦* 提交于 2020-04-17 18:45:33
问题 I want to generate member pages with Mustache, based on Data from Firebase. Right now, I am able to generate a page for one member, but all other members have the same informations than this member... Let say I have 4 members, I should be able to have 4 different pages, but right now, only one can be found (one of the members... maybe the last document of the collection or the first document of the collection. ) Any ideas of what I should change? Here is my javascript script: The first part

All members pages generated with Mustache have the same data informations of a single member

天涯浪子 提交于 2020-04-17 18:44:58
问题 I want to generate member pages with Mustache, based on Data from Firebase. Right now, I am able to generate a page for one member, but all other members have the same informations than this member... Let say I have 4 members, I should be able to have 4 different pages, but right now, only one can be found (one of the members... maybe the last document of the collection or the first document of the collection. ) Any ideas of what I should change? Here is my javascript script: The first part

Firstore create multiple documents at once

送分小仙女□ 提交于 2020-04-17 18:33:10
问题 I have given an array of document id's which I want to add to Firestore. let documentIds = [ 'San Francisco', 'New York', 'Las Vegas' ] Each document should have a predefined set of properties. let data = { country: 'US', language: 'English' } Is there some function inside the Firebase Admin SDK that can create all documents at once, without iterating through the array of documentIds? 回答1: This should help. Sam's answer will give you a good understanding of how to use batch writes. Be sure to

How to delete every collections from firestore

北城余情 提交于 2020-04-16 04:19:29
问题 I cannot find a delete button in order to erase all collections on fireStore using the Firebase console at once. I can only remove the collections one by one. Is there a way to delete everything from firebase console/import data from Json (like the firebase database) in FireStore or I have to write a script for that? 回答1: Wipe your firestore database from the command line in one go: firebase firestore:delete --all-collections -y 回答2: There is no action in the Firebase console, nor an API, to