How to create index without name default.

17 views
Skip to first unread message

Tom Vo

unread,
Sep 26, 2012, 6:30:59 AM9/26/12
to mongod...@googlegroups.com
Dear all
As you know , Mongodb is limit length size of name index is 128 character. How to create index with name index with my suggestions.

Thanks.
Tom Vo

Gianfranco

unread,
Sep 26, 2012, 12:47:22 PM9/26/12
to mongod...@googlegroups.com
If just want to name your index manually you can do it as an option (the second argument of the function ensureIndex() )

db.coll.ensureIndex({"foo": 1}, {name:"myfooindex"});
Reply all
Reply to author
Forward
0 new messages