google-cloud-firestore

multiple where query in firestore queryBuilder

可紊 提交于 2021-02-05 07:49:26
问题 I just noticed today that whenever I want to query a database I get an error which doesn't really make a sense to me and querying just stop working. It worked just fine few weeks ago. Invalid Query. All where filters with an inequality (lessThan, lessThanOrEqual, greaterThan, or greaterThanOrEqual) must be on the same field. But you have inequality filters on 'value1' and 'value2') Stream<List<MyModel>> myStream( {MyFilter filter, String category}) { return _service.collectionsStream( path:

multiple where query in firestore queryBuilder

杀马特。学长 韩版系。学妹 提交于 2021-02-05 07:49:20
问题 I just noticed today that whenever I want to query a database I get an error which doesn't really make a sense to me and querying just stop working. It worked just fine few weeks ago. Invalid Query. All where filters with an inequality (lessThan, lessThanOrEqual, greaterThan, or greaterThanOrEqual) must be on the same field. But you have inequality filters on 'value1' and 'value2') Stream<List<MyModel>> myStream( {MyFilter filter, String category}) { return _service.collectionsStream( path:

request(…).then is not a function error when making a POST request

橙三吉。 提交于 2021-02-05 07:46:16
问题 I'm trying to create a firebase function that makes a HTTP POST request whenever a new document is created. This is my code: import * as functions from 'firebase-functions'; const admin = require('firebase-admin'); const request = require("request"); exports.sendMessage = functions.firestore.document('comms/{comms}').onCreate((snap, context) => { const newValue = snap.data(); if (newValue) { //const email = newValue.email; const msg = newValue.msg; return request({ uri: "url", method: 'POST',

Firestore OncompleteListener [duplicate]

帅比萌擦擦* 提交于 2021-02-05 07:33:13
问题 This question already has an answer here : How to check a certain data already exists in firestore or not (1 answer) Closed 2 years ago . I want to see what is the error in this code for the executiom, when i compile it it just returns the values of log 1,3,2 , and i wanto log 2 to be before the 3 Log.d("1", "antes de validar"); DocumentReference docRef = db.getDb().collection("Usuarios").document(Correo); docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {

Firebase Firestore Easy to remember references

假装没事ソ 提交于 2021-02-05 07:29:06
问题 We are using Firebase Firestore for data storage. When a user creates a new room, we want the reference to be easy to remember so that a user can share the room ID/code with other users. At present Firestore will create a unique reference such as: DvfTMYED5cWdo5qIraZg This is too long and difficult to remember or share. We could set a different reference manually, but they have to be unique. The other point is that users can create multiple rooms so the reference would have to change each

Firebase admin on backend for verifyIdToken and use Firestore

∥☆過路亽.° 提交于 2021-02-05 07:24:25
问题 I'm trying to use Firebase Admin on my backend for "faking" client authentication by verifying Id Token in order to use firestore from the backend. The idea is to use my server as a middleware between my client and firestore. I can initialize FirebaseAdmin on the backend and verifyIdToken() from client properly, but I don't have an idea for using firestore after that. Can you guys show me a way for doing it? import * as firebaseAdmin from 'firebase-admin'; import firebaseServiceAccountKey

Dart Firestore add to array

有些话、适合烂在心里 提交于 2021-02-05 07:10:25
问题 I'm writing a Flutter app and am trying to add an element to an array. I'm trying to follow the example here: https://firebase.google.com/docs/firestore/manage-data/add-data#update_elements_in_an_array - however, My DocumentReference object does not have an update object: So, how do I go about adding an element to an array in this document? For reference, I'm using the cloud_firestore: 0.12.1 dependency. 回答1: The method you should use is updateData(). You pass to it a map. Here is an example

Flutter return full arrays from Firebase Cloud Firestore

好久不见. 提交于 2021-02-05 06:15:07
问题 LATEST EDIT 2nd Sept: I am not getting much traction with this, even with a bounty, so I will try and ask a simpler and more specific question. So I have reorganised the database in line with Doug's suggestions below, as I cannot otherwise reference the arrays in any way in firebase. So now I have a map of arrays, rather than just arrays. Like so: ObjectsList > CarsMap (Map) - sh899873jsa (Array) 0 "Toyota" 1 "Supra" 2 "1996" 3 "$4990" - hasd823j399 (Array) 0 "Toyota" 1 "Corolla" 2 "2014" 3 "

GCP Firestore API is not available for Cloud Datastore projects

走远了吗. 提交于 2021-02-05 05:40:47
问题 I was trying to use the GCP filestore, following the simple quick example in the product website and get an error: "google.api_core.exceptions.FailedPrecondition: 400 The Cloud Firestore API is not available for Cloud Datastore projects." I did use the datastore before in the same project, I then disabled the datastore api in the project and try out the example, still get the same error any one can suggest what to do other than creating a new project ? 回答1: If you have an empty Cloud

GCP Firestore API is not available for Cloud Datastore projects

我的梦境 提交于 2021-02-05 05:40:20
问题 I was trying to use the GCP filestore, following the simple quick example in the product website and get an error: "google.api_core.exceptions.FailedPrecondition: 400 The Cloud Firestore API is not available for Cloud Datastore projects." I did use the datastore before in the same project, I then disabled the datastore api in the project and try out the example, still get the same error any one can suggest what to do other than creating a new project ? 回答1: If you have an empty Cloud