为什么我不能在mongodb中创建索引?

时间:2012-08-29 06:09:40

标签: mongodb database

我在mongodb有一个集合,我无法创建索引

这是一个字段,我想制作索引。

"indexContents" : ["‘", "‘e", "‘ea", "‘eat", "e", "ea", "eat", "a", "at", "t", "&", "d", "dr", "dri", "drin", "drink", "drink’", "r", "ri", "rin", "rink", "rink’", "i", "in", "ink", "ink’", "n", "nk", "nk’", "k", "k’", "’"]

我的领域出了什么问题?

我可以索引,标题,街道,一切都很好。

但是当我创建包含indexContents的索引时,我收到了这个错误:

Wed Aug 29 05:50:33 Socket recv() errno:104 Connection reset by peer 127.0.0.1:27017
Wed Aug 29 05:50:33 SocketException: remote: 127.0.0.1:27017 error: 9001 socket exception [1] server [127.0.0.1:27017]
Wed Aug 29 05:50:34 DBClientCursor::init call() failed
Wed Aug 29 05:50:34 query failed : hello.$cmd { getlasterror: 1.0 } to: 127.0.0.1
Wed Aug 29 05:50:34 Error: error doing query: failed shell/collection.js:151
Wed Aug 29 05:50:34 trying reconnect to 127.0.0.1
Wed Aug 29 05:50:34 reconnect 127.0.0.1 failed couldn't connect to server 127.0.0.1

我认为其中一项数据“搞砸了”,但160万条数据中有哪一项?

更新: 我已经修复了数据库但是我得到了相同的resutl,无法创建indexContent

注意其他确保索引没问题。

例如,我可以单独索引indexContents

我可以索引 {LongitudeLatitude: “2D”,突出:1}

{indexContents:1}很好

如果我尝试索引

,事情会失败

{LongitudeLatitude: “2D”,indexContents:1,突出:1}

0 个答案:

没有答案