首页 > 数据库技术 > 详细

mongodb 建立索引提示异常:WiredTigerIndex::insert: key too large to index, failing 1483

时间:2017-03-04 17:11:05      阅读:1264      评论:0      收藏:0      [点我收藏+]
{
    "ok" : 0.0,
    "errmsg" : "WiredTigerIndex::insert: key too large to index, failing  1483 { : \"山东隔断|山东隔断厂家|山东隔断价格|山东活动隔断|山东酒店活动隔断|烟台活动玻璃隔断|山东活动展板|山东隔??...\" }",
    "code" : 17280
}

MongoDB will not create an index on a collection if the index entry for an existing document exceeds the index key limit (1024 bytes). You can however create a hashed index or text index instead:

db.logcollection.ensureIndex({"Module":"hashed"})

or

db.logcollection.ensureIndex({"Module":"text"})

mongodb 对字段中有超过 1024 字节的不会建立索引,但是可以使用text 索引或者hashed 索引来实现。

关于各种索引的区别请看:http://www.mongoing.com/archives/2797

 

mongodb 建立索引提示异常:WiredTigerIndex::insert: key too large to index, failing 1483

原文:http://www.cnblogs.com/timelesszhuang/p/6501847.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!