Firestore支持的自定义ID字符 [英] Firestore supported characters for custom IDs
问题描述
我想在Firestore中为我的文档创建自定义ID,我知道支持所有 base 62 ( az,AZ,0-9 )字符自定义ID,我需要了解Firestore支持在自定义ID中使用的特殊字符(-_ *& $#@!`〜%等),是有不受支持的特殊字符吗?
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?
也想了解空白情况,我可以创建一个像 abc 123 这样的自定义ID吗?
Also want to know about the white space case, can I create a custom ID like abc 123 ?
推荐答案
这是一个很晚的答案,但由于我自己只是在寻找此信息:
This is a late answer, but as I was just looking for this information myself:
文档ID(和集合ID为)的约束为:
The constraints on the document ids (and collection ids are) are:
- 必须是有效的UTF-8字符
- 不得超过1,500个字节
- 不能包含正斜杠(/)
- 不能仅由一个句点(.)或两个句点(..)组成
- 无法匹配正则表达式
__.* __
文档ID可能包含空格字符.
Document Ids may contain space characters.
文档ID,集合ID和字段名称的命名约束已在此处完整记录:
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小组的讨论:
Google firebase group discussion on this:
https://groups.google.com/forum/#!topic/firebase-talk/bUMpQwGe08k
这篇关于Firestore支持的自定义ID字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!