I would like to create a custom ID for my documents in Firestore, I know all the base 62 (a-z, A-Z, 0-9) characters are supported for custom IDs, I need to know about the special characters (- _ * & $ # @ ! ` ~ % etc) supported by Firestore to use in custom IDs, is there any unsupported special character?
Also want to know about the white space case, can I create a custom ID like abc 123 ?
To add Document with Custom ID to Firestore with JavaScript, we call the set method. db. collection("cities"). doc("LA").
Correct, it is extremely unlikely, but not guaranteed.
Note: Cloud Firestore supports a variety of data types for values: boolean, number, string, geo point, binary blob, and timestamp. You can also use arrays or nested objects, called maps, to structure data within a document.
There is no API to change the ID of an existing document, nor is there an API to move a document. If you want to store the same contents in a different document, you will have to: Read the document from its existing key. Write the document under its new key.
This is a late answer, but as I was just looking for this information myself:
The constraints on the document ids (and collection ids are) are:
__.*__
Document Ids may contain space characters.
The naming constraints on document Ids, collection Ids, and field names are fully documented here:
https://firebase.google.com/docs/firestore/quotas#limits
Google firebase group discussion on this:
https://groups.google.com/forum/#!topic/firebase-talk/bUMpQwGe08k
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With