Firestore支持的自定义ID字符 [英] Firestore supported characters for custom id's

查看:65
本文介绍了Firestore支持的自定义ID字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在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 id's, I need to know about the special characters (- _ * & $ # @ ! ` ~ % etc) supported by firestore to use in custom id's, 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个字节
  • 不能包含正斜杠(/)
  • 不能仅由一个句点(.)或两个句点(..)组成
  • 无法匹配正则表达式__.*__
  • Must be valid UTF-8 characters
  • Must be no longer than 1,500 bytes
  • Cannot contain a forward slash (/)
  • Cannot solely consist of a single period (.) or double periods (..)
  • Cannot match the regular expression __.*__

文档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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆