google-cloud-firestore

Firebase emulator return empty data whereas working fine after deploying

こ雲淡風輕ζ 提交于 2020-05-15 08:06:59
问题 I have a written a very basic API which will return the services. I tried to run this API in emulator but it return the empty data { "status": "success", "statusCode": 200, "message": "Services retrieved", "data": [] } I have setup the firestore, functions and database emulators. And I am using "firebase-admin": "^8.10.0", "firebase-functions": "^3.6.0" Any idea why the data response is empty ? EDIT This is my method to call the service export const activeServices = functions.https.onRequest(

How to get documents in firestore, whose document IDs are stored in the list?, i.e bring only those documents…?

99封情书 提交于 2020-05-15 07:52:09
问题 I have a list that contains the document Ids of a particular collection "users", and I want to get documents only present in this list, and these documents are in "users" collection as mention before. Code: getUsers() async { double radius = 0.3; String field = "GeoPosition"; print(currentUser.point.longitude); GeoFirePoint center = geo.point(latitude: currentUser.point.latitude, longitude: currentUser.point.longitude); var collectionRef = Firestore.instance.collection('user_locations')

Firebase-Admin package Typescript error in Cloud Functions Firestore : @types/googlemaps

会有一股神秘感。 提交于 2020-05-15 05:49:21
问题 I have two projects with similar Cloud Functions setup, both directly using Typescript setup (no Webpack) similar to this example or this one One of them uses Firestore, other one doesn't. The one that does not use Firestore compiles and deploys with no error. However the one with Firestore functions gives me this error on tsc compile: ../node_modules/@types/googlemaps/index.d.ts(33,29): error TS2304: Cannot find name 'Element'. ../node_modules/@types/googlemaps/index.d.ts(37,19): error

swift firestore check if documents exists

≯℡__Kan透↙ 提交于 2020-05-15 04:46:24
问题 using swift and firestore I want to check the "Taken User Names" collection to see if a username has been taken and if it has alert the user it taken otherwise if it's still available I want to create the file. The gist of what I want to do is outlined below, I can save the data no problem though its the checking to see if its document exists then taking action that I cannot figure out func nextButtonPressed(){ let db = Firestore.firestore() if usernameTextField.text != ""{ guard let username

Pipe Date Angular “Unable to convert ”Timestamp"

痞子三分冷 提交于 2020-05-15 02:42:09
问题 I'm trying to use a pipe in angular, specifically the following: {{fechaCreacion | date: 'medium'}} and I get the following error: Unable to convert Timestamp (seconds = 1528157765, nanoseconds = 878000000)" into a date 'for pipe' DatePipe' This is my registration in Firestore: When I just leave {{ fechaCreacion }} it shows me the following: How can I solve that? I'm using: Angular 6 "angularfire2": "^5.0.0-rc.10" "firebase": "^5.0.4", component.ts aviso: any = {}; id; titulo; descripcion;

Pipe Date Angular “Unable to convert ”Timestamp"

旧时模样 提交于 2020-05-15 02:42:04
问题 I'm trying to use a pipe in angular, specifically the following: {{fechaCreacion | date: 'medium'}} and I get the following error: Unable to convert Timestamp (seconds = 1528157765, nanoseconds = 878000000)" into a date 'for pipe' DatePipe' This is my registration in Firestore: When I just leave {{ fechaCreacion }} it shows me the following: How can I solve that? I'm using: Angular 6 "angularfire2": "^5.0.0-rc.10" "firebase": "^5.0.4", component.ts aviso: any = {}; id; titulo; descripcion;

How to skip null/empty variables in the firestore collection?

*爱你&永不变心* 提交于 2020-05-14 19:57:31
问题 Like firebase real-time database, I don't want store null/empty value in firestore collection .so how i can skip or remove null fields from firestore collection below function save data to firestore private void saveTofireStore(String path, User userObject,Class<?> classType){ FirebaseFirestore db = FirebaseFirestore.getInstance(); documentReference = db.document(path); Log.d(TAG,""+documentReference.getPath()); documentReference .set(userObject) .addOnCompleteListener(task -> { if (task

Firestore - how to exclude fields of data class objects in Kotlin

久未见 提交于 2020-05-14 15:15:28
问题 Firestore here explains, how I can use simple classes to directly use them with firestore: https://firebase.google.com/docs/firestore/manage-data/add-data How can I mark a field as excluded? data class Parent(var name: String? = null) { // don't save this field directly var questions: ArrayList<String> = ArrayList() } 回答1: Since Kotlin creates implicit getters and setters for fields, you need to annotate the setter with @Exclude to tell Firestore not to use them. Kotlin's syntax for this is

Firestore - how to exclude fields of data class objects in Kotlin

有些话、适合烂在心里 提交于 2020-05-14 15:14:47
问题 Firestore here explains, how I can use simple classes to directly use them with firestore: https://firebase.google.com/docs/firestore/manage-data/add-data How can I mark a field as excluded? data class Parent(var name: String? = null) { // don't save this field directly var questions: ArrayList<String> = ArrayList() } 回答1: Since Kotlin creates implicit getters and setters for fields, you need to annotate the setter with @Exclude to tell Firestore not to use them. Kotlin's syntax for this is

How to get the uid of the authenticated Firebase user in a Cloud Functions storage trigger

做~自己de王妃 提交于 2020-05-14 10:25:13
问题 Background: I'm using Firebase Cloud Functions, the new Firestore Database, and storage bucket with an Android client. What I want to accomplish: When a user uploads a picture to a storage bucket, I want to use cloud functions to get the file path/link to the image location in the storage bucket and store this string as a new document under a new collection called "pictures" under the currently logged in user's document in Firestore. That way, I can see the images each user has uploaded