Search code examples
google-cloud-platformgoogle-cloud-firestoregoogle-cloud-datastore

Google Datastore and Firestore - can you use emojis as an ID?


If you have a string as your entity/document id, can you safely use emojis or foreign language characters as the id?

Can you use one of these as an Id? Is there some risk if you do?

book
كتاب
書
📕
🙂
📕💙

Solution

  • Yes, you can. No, there is no risk (other than causing confusion to those attempting to read and interpret things). All strings in Firestore are UTF-8 strings as you can see in the documentation.

    In fact, I tweeted about this a long time ago.

    https://twitter.com/codingdoug/status/961302822997213184?lang=en