google-cloud-firestore

Cloud Firestore REST API - Add server timestamp

不想你离开。 提交于 2020-05-24 02:52:25
问题 I'm using an Arduino with an ESP8266-01 module to upload a value to a Cloud Firestore database using the createDocument API with the following payload: { "fields": { "distance": { "integerValue": "555" } } } I do a POST-request to a route like this: https://firestore.googleapis.com/v1beta1/projects/<MY_PROJECT>/databases/(default)/documents/<SOME_COLLECTION>?key=MY_VERY_SECRET_KEY That all works, but I would like to add the server timestamp as well. I've found a few answers here on

Should I build a local data layer/app state to maintain state in a React Native/Firestore App?

拟墨画扇 提交于 2020-05-24 02:27:34
问题 A main selling point of Firestore is the ability to use it as a online/offline source of truth. I'm using it in this way right now: updating the Firestore document directly on an action, then listening to Firestore DB changes and mapping this back to local state. However, relying on this latency compensation and mapping back to local state is not sufficient for quick updates (taps, toggles even with a small document size). For example, toggles will "jitter" as the RN toggle presumptively

Should I build a local data layer/app state to maintain state in a React Native/Firestore App?

不想你离开。 提交于 2020-05-24 02:23:27
问题 A main selling point of Firestore is the ability to use it as a online/offline source of truth. I'm using it in this way right now: updating the Firestore document directly on an action, then listening to Firestore DB changes and mapping this back to local state. However, relying on this latency compensation and mapping back to local state is not sufficient for quick updates (taps, toggles even with a small document size). For example, toggles will "jitter" as the RN toggle presumptively

React - display a firestore timestamp

风流意气都作罢 提交于 2020-05-23 08:09:26
问题 I am trying to figure out how to display a firestore timestamp in a react app. I have a firestore document with a field named createdAt. I am trying to include it in a list of output (extracting the relevant bits here so that you don't have to read through the entire list of fields). componentDidMount() { this.setState({ loading: true }); this.unsubscribe = this.props.firebase .users() .onSnapshot(snapshot => { let users = []; snapshot.forEach(doc => users.push({ ...doc.data(), uid: doc.id })

Firestore get document by id on angular 2

只谈情不闲聊 提交于 2020-05-23 04:12:42
问题 How to get document by id in google firestore? is there some get() method? because I searched but didn't find a proper answer that suits to me :( Update: this.itemscollection.doc(id).get() didn't worked for me 回答1: Try this code this.itemscollection.doc(id).ref.get().then(function(doc) { if (doc.exists) { console.log("Document data:", doc.data()); } else { console.log("No such document!"); } }).catch(function(error) { console.log("Error getting document:", error); }); 回答2: the key to success

Is there a way to limit Firebase's Blaze plan?

馋奶兔 提交于 2020-05-23 02:32:47
问题 I'm currently working in a social network app and I need to do a search feature. Firestore does not support these kind of queries, so I need to use an external service like Algolia. The problem is that the free plan does not support connecting to external websites/APIs other than Google's own ones, so I can't connect to Algolia to get my search system working. I have read multiple stories about devs paying high bills because of loops or errors in their code, and as the Blaze plan is a pay-to

Firebase firestore variable name changed

瘦欲@ 提交于 2020-05-21 07:39:08
问题 My firestore variables are saved by other names in cloud firestore. I think this is related to proguard, but I am not getting it. Following are my username. public String id; public String name; public String number; public String profilePic; public String shopPic; and following is the screenshot, what is saved on firestore. Here is some related code, which is very simple FirestoreUrls.get().getAccountsCollection() .document().set(binding.getUser()).addOnCompleteListener(new

Why is my React component is rendering twice?

淺唱寂寞╮ 提交于 2020-05-21 05:30:26
问题 I don't know why my React component is rendering twice. So I am pulling a phone number from params and saving it to state so I can search through Firestore. Everything seems to be working fine except it renders twice... The first one renders the phone number and zero points. The second time it renders all the data is displayed correctly. Can someone guide me to the solution. class Update extends Component { constructor(props) { super(props); const { match } = this.props; this.state = {

CLOUD_SDK_CREDENTIALS_WARNING We recommend that most server applications use service accounts instead

拟墨画扇 提交于 2020-05-17 08:52:19
问题 Context: I have just learn a trick to get (download) data from FireStore Dashboard. Obviouslly, it is much easier just open Google Dashboard on Browser and see with my eyes to own Google Dasboard. Nevertheless, for personal reasons, in my company the operators can't look at a third Dashboard. They only can see internal Dashboards. I am trying some workaround where I can get/download the same data used for fill in Dashboard and imported it to our internal solution based on Dynatrace/ELK. For

Firestore metadata get method doesn't succed

时光总嘲笑我的痴心妄想 提交于 2020-05-17 08:49:24
问题 I have an issue with Firebase's Firestore in my app, based on a MVVM architecture. When I try to get an object from a document reference, the addOnCompleteListener never succed (neither the other listeners). Here is my code of ItemRepo.kt in which I call the get method to my document reference. NOTE: myDocRef is used in the init of the viewModel (called by the getMyItems method that returns a Query objcet that I observe with a snapshotListener) and is ordered by those two fields. I've tried