google-cloud-firestore

How to create an auto delete mechanism for firestore? (deleting data after time period) [closed]

╄→гoц情女王★ 提交于 2020-03-17 12:20:16
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I am not sure how to start/accomplish this, I am want the documents in a collection in a firestore database to delete themselves if the document was not changed or accessed for a certain time period (for example 30 days). In other words, the data should expire (be removed) if not

How to create an auto delete mechanism for firestore? (deleting data after time period) [closed]

烂漫一生 提交于 2020-03-17 12:19:26
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I am not sure how to start/accomplish this, I am want the documents in a collection in a firestore database to delete themselves if the document was not changed or accessed for a certain time period (for example 30 days). In other words, the data should expire (be removed) if not

Add a Document's Document ID to Its Own Firestore Document - Swift 4

╄→гoц情女王★ 提交于 2020-03-17 11:58:49
问题 How do I go about adding the document ID of a document I just added to my firestore database, to said document? I want to do this so that when a user retrieves a "ride" object and chooses to book it, I can know which specific ride they've booked. The problem that i'm facing is that you can't get the document ID until after it's created, so the only way to add it to said document would be to create a document, read its ID, then edit the document to add in the ID. At scale this would create

How to save GeoPoint in Firebase Cloud Firestore?

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-17 04:44:11
问题 in the database UI I can create a field with the type geopoint . After providing values, it looks something like this: location: [1° N, 1° E] I'm trying to save this to the DB via client side SDK (web). Based on Twitter Feedback I tried GeoJSON, Coords Array and Coords Object: location: [1, 2]; location: { latitude: 1, longitude: 2, }; location: { "type": "Feature", "geometry": { "type": "Point", "coordinates": [125.6, 10.1] } } None of which resulted in the geopoint type in the database.

flutter firestore, add new object in array

。_饼干妹妹 提交于 2020-03-16 02:01:28
问题 I have array of objects, I want to add new object when user enter new data in the array? Firestore.instance.collection(city).document('Attractions').updateData( "data", FieldValue.arrayUnion(obj) ); This shows error, How can I achieve this with flutter? 回答1: Right Format is : Firestore.instance.collection(city).document('Attractions').updateData({"data": FieldValue.arrayUnion(obj)}); updateData Take Map<String,dynamic> as data. In your Code you are having , as separator between key - value

flutter firestore, add new object in array

試著忘記壹切 提交于 2020-03-16 02:01:07
问题 I have array of objects, I want to add new object when user enter new data in the array? Firestore.instance.collection(city).document('Attractions').updateData( "data", FieldValue.arrayUnion(obj) ); This shows error, How can I achieve this with flutter? 回答1: Right Format is : Firestore.instance.collection(city).document('Attractions').updateData({"data": FieldValue.arrayUnion(obj)}); updateData Take Map<String,dynamic> as data. In your Code you are having , as separator between key - value

flutter firestore, add new object in array

主宰稳场 提交于 2020-03-16 02:00:05
问题 I have array of objects, I want to add new object when user enter new data in the array? Firestore.instance.collection(city).document('Attractions').updateData( "data", FieldValue.arrayUnion(obj) ); This shows error, How can I achieve this with flutter? 回答1: Right Format is : Firestore.instance.collection(city).document('Attractions').updateData({"data": FieldValue.arrayUnion(obj)}); updateData Take Map<String,dynamic> as data. In your Code you are having , as separator between key - value

firebase2.default.firestore is not a function - React Firebase

戏子无情 提交于 2020-03-16 01:29:05
问题 I am trying to use firestore in my reactjs app. When i call firestore from firebase config object. It says firebase2.default.firestore is not a function Here is the code import firebase from 'firebase' const config = { apiKey: "AIzaSxxxxxxqpUeqKXI", authDomain: "payxxxxxa1.firebaseapp.com", databaseURL: "https://payxxxxxxxa1.firebaseio.com", projectId: "payxxxxxxja1", storageBucket: "payxxxxxa1.appspot.com", messagingSenderId: "281xxxxxxxx576" } firebase.initializeApp(config) export const

How to only store data for current logged in user using Firestore

独自空忆成欢 提交于 2020-03-14 03:59:29
问题 Below is the code which allows the user to store data into Firestore. The problem is, the uploaded data is viewable for all the users logged into the app. How would I be able to only allow the current user logged in to store the data for their account only? With Firebase Database I use the following code (which works, but not for Firestore) FirebaseUser user= FirebaseAuth.getInstance().getCurrentUser(); String userId=user.getUid(); mDatabaseRef = FirebaseDatabase.getInstance().getReference(FB

How to get data from Firebase Firestore?

戏子无情 提交于 2020-03-12 06:14:52
问题 In this code I added "Comment" in firestore this is not problem. btnAddComment.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { btnAddComment.setVisibility(View.INVISIBLE); DocumentReference comment = firestore.collection("Comment").document(postKey); String comment_content = editTextComment.getText().toString(); String uid = currentUser.getUid(); String uname = currentUser.getDisplayName(); String uimg = currentUser.getPhotoUrl().toString(); Comment