Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have root collection, inside that two documents having the same Document Id. The first document having data and the second is in italic format. On click of the second document, it will navigate to an error page saying that the project does not exist or either you do not have permission. Attaching a screenshot for reference.
It showing two document with the same DocumentId first in normal case and second in Italic. "Maharashtra", "Maharashtra".
At some point in the past, you have deleted the document "Maharashtra" without recursively deleting it's child collections.
These collections are still present in your database but not currently attached to the parent document. As an example, the document "/states/Maharashtra/logs/day1" might exist with data, while it's parent collection "/states/Maharashtra/logs" is not a part of the current document "/states/Maharashtra".
You should be able to expand the italicised entry to see it's orphaned sub-collections.
#puf explained it better here.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 months ago.
Improve this question
I try to link a document to another document in my database. As far as I understand, I can save the ID or a reference to it.
What's the difference between those methods and which one suits me better?
A simple string document ID has no context while a Reference contains the entire path to a document. For the ease of use in a custom objects it will be useful to have the entire Reference object stored.
When writing queries you can also filter on a Reference object in the database by comparing it to another.
However, it's a personal preference. Anything that a string can do, Reference can also provide. Having a Reference type can saves you for trouble of building a new Reference object in your code and you can also use it in security rules for the same purpose when it comes time to use get() to fetch another document referenced by a field.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 months ago.
Improve this question
How add this -N8O6lC8cGgMfLE_8BIR data from the reference Colis Futur to reference Colis Requetes
Here's what should happen. just below
If you want to copy a RTDB node from one parent node to the another one, you need to first read it from the source parent node and then write the node (it's value + key) under the parent target node.
How to do that depends on your exact techno/functional requirements. You could do that from your front end, if for example you app is a "Colis" management app or you could do that in the back-end with a Cloud Function, for example if you want to denormalize your data according to the NoSQL "philosophy".
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
In Cloud Firestore, I want to add a collection like for ex. A,B,C and ..... within document I want to add two things(fields) basically
a image, and
a URL
Since I am new to Firebase ...Can anyone help me with this problem
As suggested by Vinamra Jaiswal, you need to store the URL as a string in the Firestore, you can refer to "How to store multiple url in firestore using flutter" for an example.
As for the image you can refer to "firestore database add image to record", where you can see that it is wiser to store the images in the Cloud Storage and then download the URLs and store them in Firestore.
You can also refer to the "Upload image to Cloud Storage, save URI in Firestore" video to get more insight on how to do this.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am making a todo list with React and firebase, I have placed a delete button beside every item . Is there a way to delete the item without having to fetch its document id?
You can't make any changes at all to any document without knowing its ID. The APIs for updating documents require that you provide a DocumentReference, and the only way you can build a DocumentReference is using a document ID.
If you don't know the document ID, you will have to query the collection, iterate the results, and somehow locate the document you're looking for.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i'n trying to figure out, what's the best practice for building collections associated with user's data.(In terms of reactive, queries speed, or other.)
For example, what's better?
Meteor.Users.profile: {friends, likes, previous orders, locations, favorites, etc"}.
Or create additional collection to keep this data, for example:
Meteor.UserInfo.user{friends, locations, previous orders, etc").
Thanks.
Use the Users collection to store information about that user that isn't related to other collections. Typically this should be at the top level of the user document, not inside the profile. The only thing I'd expect to see in the profile is profile information (and not, for instance, a list of previous orders).
Things like previous orders shouldn't be there since you can just query the Orders collection to find them. For performance reasons it is sometimes useful to denormalise this data, but this should be an exception, not the rule.