google-cloud-firestore

Firestore use contains on multiple fields

点点圈 提交于 2021-01-29 22:26:00
问题 I have an upcoming video games app. A game release can come out on multiple platforms. I heard that firestore is much more flexible than firebase real time database on how you can retrieve your data. I'm stuck on how can I check if my game release documents in my release collection contains the user chosen platforms, so the app can show the games coming out on his platforms. This is what I currently have platforms is a list of Integer which contains platforms ids databaseReference.collection

Firestore FieldValue.increment()

此生再无相见时 提交于 2021-01-29 21:53:30
问题 I'm trying to use firebase.firestore.FieldValue.increment() , but FieldValue.increment() method is not available. I have attached an image contain available methods for firestore. This is my import: import firebase from "../../firebase/firebase_config" //Usage increment = firebase.firestore.FieldValue.increment(1); Please assist, maybe I am missing something here. Firestore Documentation Image of firebase.firestore.methods() EDIT 2: Below is the Firebase config import import firebase from

Google Firebase Angular Firestore switchMap - Firebase Error DocumentReference.set()

跟風遠走 提交于 2021-01-29 21:53:14
问题 I'm trying to setup an Angular Firebase app where the user data that I want to share with the App is stored in the Firestore Database. I'm getting the following error: ERROR Error: Uncaught (in promise): FirebaseError: [code=invalid-argument]: Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in field role) My data is setup as follows: My user service is setup like this: auth.service.ts import { Injectable } from "@angular/core"; import {

Angularfire snapshotChanges() vs Firestore javscript library onSnapshot()

蹲街弑〆低调 提交于 2021-01-29 21:20:50
问题 I found there's two realtime listener for firestore. Angularfire: snapshotChanges() Firestore javscript library: onSnapshot() Here is my question May I know what is the difference? How should I use them properly (I'm developing using Ionic + Cordova + Angular framework)? How to detach snapshotChanges()? Refer to Firestore documentation, I can detach onSnapshot() as per below. var unsubscribe = db.collection("cities") .onSnapshot(function (){ // Respond to data // ... }); // Later ... // Stop

Firestore write security rule for specific user using auth names

空扰寡人 提交于 2021-01-29 21:11:17
问题 New to Firestore security rules and is trying to understand it. I'm trying to write a security rule that allow only admins in my collection to write data and every one to read it. The collection of admins has document ids as admin names, that is for example, "Mary Lane". Within the documents I've fields: email: "userMailId@mail.com" uId: "firestore_user_Id" The uId is the id of Firestore user id. The data to write is an object Message and is: new Message(uId, title, messageBody, timestamp)

Firestore FieldValue.increment()

China☆狼群 提交于 2021-01-29 20:16:09
问题 I'm trying to use firebase.firestore.FieldValue.increment() , but FieldValue.increment() method is not available. I have attached an image contain available methods for firestore. This is my import: import firebase from "../../firebase/firebase_config" //Usage increment = firebase.firestore.FieldValue.increment(1); Please assist, maybe I am missing something here. Firestore Documentation Image of firebase.firestore.methods() EDIT 2: Below is the Firebase config import import firebase from

Firestore use contains on multiple fields

ε祈祈猫儿з 提交于 2021-01-29 20:08:29
问题 I have an upcoming video games app. A game release can come out on multiple platforms. I heard that firestore is much more flexible than firebase real time database on how you can retrieve your data. I'm stuck on how can I check if my game release documents in my release collection contains the user chosen platforms, so the app can show the games coming out on his platforms. This is what I currently have platforms is a list of Integer which contains platforms ids databaseReference.collection

Flutter firestore getting data receiver: null error

半腔热情 提交于 2021-01-29 19:56:30
问题 I searched a lot but couldn't find a solution. I need your help. In my database model, I have a method like this to get the data: Future<Map<String,dynamic>> getSystemSettings() async { var response = await _firestore.collection("system").doc("settings").get(); return response.data(); } Later, I want to use the data in the form of Map <String, dynamic> from the class I want to get the data from by calling the method as follows. getValues() { database.getSystemSettings().then((value) { print(

Flutter/Firebase - type 'Future<int>' is not a subtype of type 'int'

吃可爱长大的小学妹 提交于 2021-01-29 19:26:47
问题 I'm new to flutter and this is probably a simple question but i'm looking for a bit of an explanation to help me understand futures and future builder more. I am trying to query firebase (depending on what a user clicks on a previous screen) and i'd like to wait for all the data to be loaded before anything is shown. To do this I thought a future builder would be most appropriate as i'm going to be showing some products that won't change a great deal. I created my getData function: Future

Firestore Pricing for deletion

可紊 提交于 2021-01-29 19:18:32
问题 If I perform a query to delete a document that does not exist in my firestore database, will I be charged for the delete operation, read operation or will not be charged at all? 回答1: Please refer to the documentation. If you make a query, you will be charged a read for each document returned by the request, regardless of what you do with it. If you attempt to delete the document from a query, you will be charged a delete if the delete actually succeeds in deleting that document. Document