您的位置:首页 > 数据库 > Mongodb

mongodb索引长度限制

2017-05-06 18:30 141 查看

mongodb索引长度限制

集合中索引不能超过64个

索引名的长度不能超过128个字符

一个复合索引最多可以有31个字段

可以使用db.collection.ensureIndex({indexName:1},{name:”xxxIndexName”})指定name的长度。

Number of Indexes per Collection

A single collection can have no more than 64 indexes.

Index Name Length

Fully qualified index names, which includes the namespace and the dot separators (i.e. ..$), cannot be longer than 128 characters.

By default, is the concatenation of the field names and index type. You can explicitly specify the to the createIndex() method to ensure that the fully qualified index name does not exceed the limit.

Number of Indexed Fields in a Compound Index

There can be no more than 31 fields in a compound index.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: