Newest 'google-cloud-firestore' Questions - Stack Overflow

Questions tagged [google-cloud-firestore]

Cloud Firestore is an auto-scaling real-time document database for storing, syncing, and querying data for mobile, web and server development.

0
votes
1answer
7 views

Flutter: Keeping stream active through routes?

What is the correct way to keep a stream open between screens in Flutter? For example, if I have a Firestore field (test_field) that I want to update in real-time on two screens, how would I do that?...
0
votes
0answers
9 views

vuexfire firestoreAction, binding with arg

I'm trying to bind my module's store to a document import Vue from 'vue' import { db } from '../my-firebase/db' import { firestoreAction } from 'vuexfire' export const user = { ... actions: { ...
0
votes
2answers
10 views

How do i use firebase realtime database and firestore together in one app in angular

I am setting up a new project on angular using firebase. After certain period of time i realise i need the firestore also included into my project. Now the problem is that how do i configure that in ...
0
votes
0answers
12 views

Querying firestore documents where document field is part of an array [duplicate]

I have an array of strings ["James", "Luke", "Ben", "Daniel"] and I want to get all documents from a specific collection which have a "name" field that's either James, Luke, Ben or Daniel. So I want ...
0
votes
0answers
20 views

Multiply reading of document references from Firestore using tasks

I have a Map of references which I read from Firestore. these refs lead me to documents that I'm willing to use their data to create an instance of my class 'Contact'. In order to do that I've ...
0
votes
0answers
12 views

How pass string value as firestore query?

I want only those documents from firestore which has a particular tag. Here is my code class ByCategory extends StatefulWidget { String tag; ByCategory(this.tag); @override _ByCategoryState ...
0
votes
0answers
7 views

How to create restricted Api Key to use directions api?

i'm creating an app that's draw routes between users using only firestore to update users location. the problem is to use direction api i need Restricted key using (server IP addresses) what should ...
0
votes
1answer
14 views

Is there a way to download the image to the gallery by receiving the URL which I uploaded to Cloud Firestore?

I stored some url to the Cloud Firestore and I successfully displayed those images to my app but the question is "can I download the image using that url ?" If possible please help me I watched alot ...
0
votes
1answer
14 views

i want to save and retrive all contacts to Firebase Firestore, need structure to save and retrive contacts

I am developing an app, there's a functionality to get all the contacts of the user and upload it to server. Here I'm using Firebase Firestore as my backend. I can able to get all contacts without ...
0
votes
1answer
15 views

Update an object with notation with a parameter?

In my firebase i have a collection, inside there is a document, and inside there is an object : object 1 key1:value key2:value key3:value I would like to only update certain keys inside an object ...
1
vote
1answer
28 views

Why is print(snapshot.hasData) returning true?

I must be misunderstanding the hasData method for a QuerySnaphot. In my StreamBuilder I want to return a widget informing the user there are no items in the collection queried. I've deleted the ...
0
votes
1answer
45 views

Passing props down in Svelte

I'm trying to implement a fairly standard blog app using Svelte, Svelte Routing and Firestore, but I think I'm misunderstanding a fundamental part of how props are passed between components. I based ...
0
votes
2answers
41 views

Deleting an item from a collection in f, using React Redux

I'm trying to delete an item from a collection in Firestore by referencing the id of the selected item. I'm successfully passing on the id by mapDispatchToProps until the action but stops short when ...
0
votes
0answers
14 views

Convert Firestore DocumentSnapshot to Map in Flutter

I need to update a document with nested arrays in Firestore with Flutter. So I need to get the full document into a Map, reorder the maps in the "sections" array, and then store the data back into ...
0
votes
0answers
11 views

iOS Firestore Can `FieldValue.increment` be used for Map values?

Is it possible to use FieldValue.increment(_:) on Map field values? For instance, if you have a field called foo whose value is a Map type, and inside foo is a key-value pair bar: Int, can you ...
0
votes
0answers
12 views

Why aren't my data points getting placed in the corresponding locations in my chart?

I have a nuxt component that loads a chart using chart.js filled with data from a Firestore database. The data points are loading as a flat line at the bottom of my chart. However, the data has ...
0
votes
2answers
17 views

Get user's events with Firebase (many to many relationship)

I'm a Front-End Developer and for the first-time, I'm using Firebase to build an application. I read some documentation/articles and watched this interesting video about foreign keys (many to many ...
0
votes
0answers
15 views

firestore implementing private chats is broken for me

I am attempting to have it so when a user attempts to access the "chats" collection it will only allow them to read it if their UID is in one of the two fields "Debater" / "Owner" so that say for ...
0
votes
0answers
18 views

Firebase cloud function onCreate is not working

I want to set listener for firestore, but my onCreate function totally isn't working, can't even put some log. I set up cloud function with official tutorial, so I don't know what's wrong. My ...
0
votes
0answers
15 views

Using stream provider on one page doesnt provide the value on the next page after routing with context

I have a task list page, that is listening to a stream of task, when i click on one of the tasks and route to a task details page. i can no longer access the provided tasks stream. This also happens ...
-1
votes
1answer
31 views

How to fix “Uncaught TypeError: Cannot read property 'Timestamp' of undefined”?

Hi I'm new in web development and I'm trying to make a firebase app with the firestore database. I have a user registration form and in this form I need to get the date. For the date I used datepicker ...
0
votes
1answer
14 views

Firebase: how to fix Error: ENOENT: no such file or directory, open 'node_modules/protobufjs/google/protobuf/api.proto'

We are making the following query to cloud firestore: ` var meeting = await db.collection("meetings").where( "pin", "==", request.body.Digits).where( "status", "==", "in-progress").get()` ...
0
votes
1answer
23 views

Store Firestore data inside of mock

Currently I'm distributing data inside of my app using a mock containing an array (you can find the code below). I iterate through this array in each component that need it. export const CASES: Case[]...
0
votes
1answer
20 views

Why is it okay to allow writes into Firebase from the client side?

I know when querying from Firebase, you should be extra careful on making sure you're reading the data you want to, but aren't front end writes susceptible to malice? For instance, an attacker could ...
-1
votes
1answer
23 views

How to implement chat application like WhatsApp using flutter and google cloud

I am trying to make a chat app where I want to implement peer to peer communication of messages. I am using firestore to store the chats online and a offline sql database because firestore always ...
0
votes
0answers
10 views

Firestore querying by due date for items due today

Am having troubles querying my database for items due today. _firestore .collectionGroup('tasks') .where('dueDate', isEqualTo: DateTime(now.year, now.month, now.day)) since firestore save ...
0
votes
0answers
12 views

Using provider and firestore to manage state, but can't get real time updates on detail view

I have a list of tasks that am fetching from firestore and providing it as a stream to my tasklist component, but when i pass a task to a taskdetails component page and update that task, my stream and ...
0
votes
1answer
15 views

How to reference images from a Google Firestore?

My app use a Google cloud Firestore instance. Among the data my App manages there some classical data (string, number, ...): No problem with that / Firestore handle these use case easily. But my app ...
0
votes
0answers
14 views

Giant query with angularfire2 and ionic 4

I have a collection with many documents inside, go from 5k of records and I need to create a function to return those records with the best possible performance using Ionic 4 and AngularFire2. At the ...
1
vote
1answer
32 views

addSnapshotListener swift firestore behaviour

I have a document in Cloud firestore to which I listen for updates. It has 2 fields, it has a field description and a field for a picture. The picture is approximately 0.2 mb and description is a few ...
1
vote
1answer
22 views

Get Realtime-Update of an Array of DocumentReferences

I'm writing a Game, where the users can join a Lobby to play together. Therefore I update the Lobby and the Users, stored in Firestore. The Lobbys in the Lobby-Collection contain an Id, creator, ...
1
vote
1answer
41 views

Unable to remove item from list of objects in typescript

I'm using the following code to retrieve a list of objects from firebase. I need to remove an item from the list but I keep getting -1 for the index. What am I doing wrong here? filterItineraries(...
0
votes
2answers
15 views

Firestore query in function return

I have array in Firestore which I would like to use in many places. The best for me would be to have function with return like this: function getWarehousesArray() { let db = firebase.firestore();...
0
votes
1answer
16 views

When i add orderBy app is not working in firestore

Uncaught Error in onSnapshot: Error: The query requires an index. You can create it here at new FirestoreError (index.cjs.js:352) at JsonProtoSerializer.push../node_modules/@firebase/firestore/...
0
votes
2answers
28 views

Limit frequency with which firestore retrieves data

I am using swift and Firestore and in my application I have a snapshotlistener which retrieves data every time some documents are changed. As I expect this to happen many times a second, I would like ...
0
votes
1answer
21 views

How do i structure firestore database in flutter to easily access other collections related to the user?

I have a firestore db but right now it only has a collection of users, with the documents named as the unique user's email they signed up with and then inside the document is the other info. For the ...
0
votes
1answer
21 views

How to use json and serialization with firebase and bloc? Error: Converting object to an encodable object failed

this is my cloud firestore looks like: Error Message: Unhandled Exception: Converting object to an encodable object failed: Photography used jsonSerialization for my database import 'package:...
0
votes
1answer
32 views

JavaScript functions return value is undefined snapshot from firestore

I've got the following code. The return value of the function caloriex is always undefined. When I show the value being returned just before the return statement it shows the correct value. But when ...
0
votes
0answers
19 views

Flutter - querying on firestore to see if the array contains a list of Strings

I'm trying to implement a search function with flutter and firestore that I can search items with some tags-like feature. e.g. I would like to search for some snacks that is available at Walmart, ...
0
votes
0answers
11 views

Firestore Timeout [duplicate]

I am getting this error when the internet connection is too poor or might be there are some firewall blocks. How could I resolve this error: [2019-06-22T05:49:47.163Z] @firebase/firestore: ...
0
votes
1answer
34 views

How to implement multiple item selection on spinner with check boxes

DocumentReference docRef7 = FirebaseFirestore.getInstance().collection("admin").document("users_profile").collection("dynamic_profile").document("city"); docRef7.get().addOnCompleteListener(new ...
0
votes
2answers
48 views

Writing a recursive search function to return a object;

I am trying to write a search function that can search through an array of arrays of objects and return any objects that include the search string in the name. The issue I am having is that the ...
1
vote
0answers
15 views

Firestore: Repeated firestore.set() cause error: Element at index 0 should not be an empty string

I have a page where users can enter their information. When the user clicks "Save", I would package everything into an object and send it to my cloud function using AJAX. There, I have a server set up ...
0
votes
0answers
18 views

how to update document inside of firestore cloud trigger function

I want to update a blob document with count of comments when a new comment gets created. I want to use trigger onCreate with typescript. Is that possible with cloud store? This is what I have so ...
1
vote
1answer
27 views

Chaining Firebase Firestore documents/collections

So, I have a Firestore database group like so. companies > acme-industries > items > [] OR collection > document > collection > document Would it be better to just store all items ...
0
votes
0answers
14 views

How to fix “Unhandled Rejection (Error): not supported” error in React+Cloud Firestore

I am trying to query a Cloud Firestore database with the following query: db.collection("shops").where("email", "==", user.email).get() .then(...) .catch(...) I have written code in the "catch" ...
0
votes
1answer
44 views

Forcing one then() statement to wait for completion of the other

I am using React and getting data from my Firestore DB in my componentDidMount() method. I have two then() calls, one for when the data from the DB becomes available and I can save it, and the other ...
0
votes
1answer
19 views

How to update collection documents efficiently when changing a specific value in Firestore?

I have 2 collections. One of them is named "USERS", and the other one "MATCHES". USERS, can join in the MATCHES, appearing the avatar of the user who has joined in the match. The problem is that when ...
0
votes
1answer
34 views

How do I obtain the data returned by a Cloud Firestore query? [duplicate]

I have written the following code to render some posts (which are stored in a Cloud Firestore instance). I am using mithril.js. let SummaryPostView = { posts: [], view: function () { let ...
1
vote
0answers
18 views

Android not catching Firestore Transaction PlatformException

I am build random 1:1 chat app in Flutter and Firebase. I am use transaction for add user to chat because must avoid race condition of more than 1 user be add to chat. Chat must be 1:1. I need catch ...