google-cloud-firestore

Firestore : How search in the entire database?

南楼画角 提交于 2021-01-29 02:09:12
问题 I hope you are well !! My database looks like below: / CLASSROOM1 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] / CLASSROOM2 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] / CLASSROOM3 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] I would like to know if it is possible to search the entire Firestore

Firestore : How search in the entire database?

我是研究僧i 提交于 2021-01-29 02:06:57
问题 I hope you are well !! My database looks like below: / CLASSROOM1 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] / CLASSROOM2 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] / CLASSROOM3 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] I would like to know if it is possible to search the entire Firestore

Firestore : How search in the entire database?

徘徊边缘 提交于 2021-01-29 02:06:23
问题 I hope you are well !! My database looks like below: / CLASSROOM1 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] / CLASSROOM2 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] / CLASSROOM3 [collection] ----> DATAS [document] ----> USERS [collection] ----> userdId [document] ----> [user data (field)] I would like to know if it is possible to search the entire Firestore

How does Firebase Firestore emulator work?

早过忘川 提交于 2021-01-28 21:51:13
问题 So far I've been using Firebase Hosting and Functions emulators. But now I'm writting a function that will run based on a Firestore trigger, so I'm looking into the Firestore emulator for development. But how does it work? Does it mimics Firestore completely? Will I be able to read my current Firestore data that it's saved on server? And what if I update, create or delete change documents, will I be really changing them in my real data as well? I'll run it with: firebase emulators:start -

How to avoid N + 1 queries in Firestore?

谁说我不能喝 提交于 2021-01-28 20:32:00
问题 Is there something similar to the "populate" method in Mongodb and includes in rails where Document Id's that are associated with other documents can be populated instead of me having to iterate through each document and make a separate query. For instance let's say that I have a group document that has a collection called members. And each document in that collection corresponds to the ID of a User document. Is there any way to populate each one of those documents, without me actually making

Querying with two array with firestore security rules

梦想的初衷 提交于 2021-01-28 20:02:46
问题 I currently have two arrays in a single document, one representing product ids and the other representing user ids. In my query, I need to query both of the arrays for firestore security rules to work correctly, but to do that, I tried using array-contains and in in the same query, which is acceptable in the documentation, but when I go to query, I get "missing or insufficient permissions". db.collection('Depots') .where("products", "array-contains", productId) .where("users", "in",

How to use where and update [duplicate]

守給你的承諾、 提交于 2021-01-28 19:46:32
问题 This question already has answers here : update cloud firestore document without id (1 answer) Way to query and update data in Firestore (1 answer) Closed 6 months ago . I'm trying to do this: database.collection('UsuariosDev').where('Telefono', '==', textInput.current.value) .update({ citas: firebase.firestore.FieldValue.arrayUnion(database.doc('NegociosDev/Peluquerías/Negocios/PR01/citas/' + docRef.id)) }) Get the doc from the collection "UsuariosDev" where "Telefono" equals "textInput

How can I join data with React native and a many to many firebase firestore collection relationship?

江枫思渺然 提交于 2021-01-28 19:22:14
问题 I am new to react native and firebase but understand SQL relationships. I am trying to understand how to model many to many relationships with firebase in NoSQL. In my scenario, users can own multiple groups and groups can have multiple user owners. I want to display group information (name, city state) for a particular user. (In this case, doc id: WQQZ6pcMMgQoTxH9cr2XGaPOq9W2). This is how data is structured in the firebase filestore: { "__collections__": { "Group": { "group3": { "city":

How to setup test data when testing Firestore in XCode with Firebase Emulator?

放肆的年华 提交于 2021-01-28 19:16:15
问题 I have been trying to setup Firebase Emulator with test data for days. What I have done? I have successfully deployed Firebase Emulators I have written a test which checks for a value in the emulated Firestore and the test passes as well. func test_WhenPartyNameIsUnique_ThenErrorIsNil() { // given let exp = self.expectation(description: "Waiting for Firebase Emulator") // when self.sut.isUnique(partyName: "akshit") { (error) in // then XCTAssertNil(error) exp.fulfill() } self

SwiftUI - Passing a variable to Observable Object

随声附和 提交于 2021-01-28 19:03:40
问题 I have a view that's receiving an ID value from the previous view. I need to also take that ID value and pass it into an ObservableObject so that I can run a Firestore query on that ID. I'm at a loss as to how to grab that ID for my ObservableObject. struct ItemView: View { var itemName: String var itemID: String @ObservedObject var items = getItemsData() // ..... etc } class getItemsData() { @Published var data = [items]() init() { let db = Firestore.firestore() db.collection("items")