google-cloud-firestore

Firestore ServerTimestamp Query

最后都变了- 提交于 2021-01-07 02:49:14
问题 I am wondering if there is a possibility of the Firestore ServerTimestamp to be exactly the same for 2 or more documents in a given collection, considering that multiple clients will be writing to the collection. I am asking this because, Firestore does not provide an auto-incrementing sequential number to documents created and we have to rely on the ServerTimestamp to assume serial writes. My use-case requires that the documents are numbered or at least have a semblance to a "linear write"

How to set documentID in firestore using flutter

牧云@^-^@ 提交于 2021-01-07 02:16:50
问题 I am trying to set my documentID manually in my flutter application but it keeps creating a new field inside my document named DocumentID. How do I set my documented? final barcode = TextEditingController(); final price = TextEditingController(); final stock = TextEditingController(); final color = TextEditingController(); ///the above are textformfield controllers I use for the data input addData() { Map<String, dynamic> theData = { //"DocumentID" : barcode.text, "Color" : color.text, "Price

Flutter: Lazy Load data from firestore

醉酒当歌 提交于 2021-01-07 01:21:17
问题 Note: I have already seen answers on Lazy Load of ListView but those are for custom API not firestore database! I have a books summary app, App fetches data from my Firebase/Firestore database and then display it using a ListView.builder which is wrapped inside a StreamBuilder . Now, I want to fetch data lazily, I mean as the user scrolls through the List the required data gets loaded rather than loading data at once and then displaying it lazily. //The Widget used to display data: Widget

How to save the Image to Firebase storage and save the URL to firebase firestore?

柔情痞子 提交于 2021-01-07 01:17:11
问题 Hi I am trying to save an image which is picked from gallery or camera. Future<void> getImage({ImageSource source}) async { _pickedImage = await ImagePicker().getImage(source: source); if (_pickedImage != null) { _pickedImageFile = File(_pickedImage.path); } } After picking the image it has to update image to the firebase storage. void _uploadImage(File image) async { Reference storageReference = FirebaseStorage.instance .ref() .child('UserImage') .child("UserImage/${user.uid}"); UploadTask

How to save the Image to Firebase storage and save the URL to firebase firestore?

梦想与她 提交于 2021-01-07 01:07:48
问题 Hi I am trying to save an image which is picked from gallery or camera. Future<void> getImage({ImageSource source}) async { _pickedImage = await ImagePicker().getImage(source: source); if (_pickedImage != null) { _pickedImageFile = File(_pickedImage.path); } } After picking the image it has to update image to the firebase storage. void _uploadImage(File image) async { Reference storageReference = FirebaseStorage.instance .ref() .child('UserImage') .child("UserImage/${user.uid}"); UploadTask

Create Firestore database documents from Postman

十年热恋 提交于 2021-01-06 05:36:11
问题 I'm trying to create multiple documents at once in a Firestore collection with configuration purposes. I can create documents one by one sending from Postman: { "fields": { "category":{"stringValue": "Configs"}, "order":{"integerValue":"3"} } } I was wondering if there is some way to create multiple documents sending something like this: { "batch": [ { "fields": { "categoria": { "stringValue": "Configurações" }, "ordem": { "integerValue": "3" } } }, { "fields": { "categoria": { "stringValue":

Create Firestore database documents from Postman

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-06 05:31:39
问题 I'm trying to create multiple documents at once in a Firestore collection with configuration purposes. I can create documents one by one sending from Postman: { "fields": { "category":{"stringValue": "Configs"}, "order":{"integerValue":"3"} } } I was wondering if there is some way to create multiple documents sending something like this: { "batch": [ { "fields": { "categoria": { "stringValue": "Configurações" }, "ordem": { "integerValue": "3" } } }, { "fields": { "categoria": { "stringValue":

Create Firestore database documents from Postman

半世苍凉 提交于 2021-01-06 05:31:34
问题 I'm trying to create multiple documents at once in a Firestore collection with configuration purposes. I can create documents one by one sending from Postman: { "fields": { "category":{"stringValue": "Configs"}, "order":{"integerValue":"3"} } } I was wondering if there is some way to create multiple documents sending something like this: { "batch": [ { "fields": { "categoria": { "stringValue": "Configurações" }, "ordem": { "integerValue": "3" } } }, { "fields": { "categoria": { "stringValue":

how to upload image Url Uploaded to Fire Storage and Save it in fireStore at the Same time Using Java

强颜欢笑 提交于 2021-01-06 03:29:42
问题 Here's my code where i can retrieve the image Url in Toast message where it is unable to save it in firestore please tell me if there is another method to do it or is the problem where i store the URL: public class register extends AppCompatActivity { EditText emails; EditText passwords; EditText ages; Button registers; Button addImage; EditText country; FirebaseFirestore db; FirebaseAuth auth; FirebaseUser auth1; private StorageTask task; Uri url ; Uri imageUri; static final int IMAGE

how to upload image Url Uploaded to Fire Storage and Save it in fireStore at the Same time Using Java

别说谁变了你拦得住时间么 提交于 2021-01-06 03:28:20
问题 Here's my code where i can retrieve the image Url in Toast message where it is unable to save it in firestore please tell me if there is another method to do it or is the problem where i store the URL: public class register extends AppCompatActivity { EditText emails; EditText passwords; EditText ages; Button registers; Button addImage; EditText country; FirebaseFirestore db; FirebaseAuth auth; FirebaseUser auth1; private StorageTask task; Uri url ; Uri imageUri; static final int IMAGE