Does Firebase storage offer unique Id's for files? [duplicate] - firebase

This question already has answers here:
Store files with unique/random names
(5 answers)
Closed 6 years ago.
So the realtime database offers me a direct way to reference a node by using its ID. Until now though, I have only seen examples of Firebase storage using the filename to create a reference. What if two files have the same name though? Must I prevent the user from uploading duplicate filenames? The URL is unique but as far as I know you aren't able to create a reference to the file based on it. Is there something I'm missing because this doesn't seem right to me. Thanks for your help.

In Firebase Storage it is up to you to determine the file name when uploading the file. There is no built-in method to generate a unique filename for Firebase Storage (like the push() method in the database).
If you have two references to the same path, they will be referring to the same file in Firebase Storage.
If you want globally unique filenames, you'll have to generate those yourself. One way would be to use the Firebase Database's push() method, but you can also use any other GUID-generator for your platform of choice.

Related

Is it possible to create a document template in Firestore? [duplicate]

This question already has answers here:
Firestore Documents Template [duplicate]
(1 answer)
Firebase Firestore: Is there a way to enforce required fields for all documents in a collection?
(3 answers)
Closed 7 months ago.
I need to add many documents to my firestore database and they all need the exact same fields. Is it possible to create a "template" so I don't need to keep adding the same fields to each document I make?
There is no concept of a document template in Firestore. If you need this, most devs create a simple administrative app, and you could of course also consider using one of the 3rd party content management systems that support Firestore.

Prevent duplicate entry in firebase database [duplicate]

This question already has answers here:
How do you prevent duplicate user properties in Firebase?
(2 answers)
Closed 3 years ago.
I want to add rule so that no duplicate rdate is added in database.
I am beginner to firebase and i don't know how to create rules for stopping duplicate.
This isn't possible with security rules, because rules don't have a way of performing queries for other nodes. The only way you can access other nodes in the database is using val() at the specific location you're interested in knowing about, but you have to know the full path to that specific location.
Your alternative is to make a request through a backend you control (such as Cloud Functions), and have that backend perform the query to check if there is a conflict.

Text search on firestore document field [duplicate]

This question already has answers here:
Firestore Comparison Operators - contains, does not contain, starts with
(2 answers)
Closed 4 years ago.
I am using cloud firestore as my database for my angular application. I wanted to implement text based search but the only option I see is using Angolia but I don’t want to use a 3rd party service. Is it possible to implement text search with just the functionality provided by firestore. Even if it returns the object by matching the first characters will work for me it does not have to be a “contain” query.
Firestore does not support full text search in any form. That's why the documentation suggests the use of another service.

Get a backup of the XML for a an Azure Resource Group

I can use the powershell command: New-AzureRmResourceGroupDeployment, with a relevant template file to create an instance of all the items within the template. In fact, this is how I initially created some of the components in the current resource group I am working on. Since creating my Azure components I have tweaked things quite a lot, and I would like to create a template based on the setup in my resource group as it stands now, this would allow me to run the above command and to recreate the components if I ever need to.
Can anyone tell me if there is a way to create a template based on an existing resource group?
Looks like there are some MS docs detailing the process here:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-export-template

Working with multiple workspaces in Alfresco

Sorry but I can't find documentation about this...
If I want to use more than one workspace in Alfresco, how can I specify the workspace to use?
For example, to access a node, I use an url like this:
workspace://SpacesStore/32da316f-9d2a-4e57-a28b-89d86bff6584
If I have various workspaces (A and B)... How can I difference one from another with this url?
And on the code side... when I use Alfresco API Java operations, I authenticate with user and password (with getAuthenticationService().authenticate method). And do something like, for example, a query to search a node (TYPE:"{mymodel}exp" AND PATH:"/app:company_home/app:user_homes/cm:mydir").
My question is the same... How can I specify one or other workspace to search in A or B? Has a different spacestore?

Resources