can i write script file to create index of collection in mongodb in unix.

699 views
Skip to first unread message

rjgcx terry

unread,
Oct 13, 2011, 2:49:29 AM10/13/11
to mongodb-user
I know how to create index in mongodb client.

But I don not know how to perform a shell script .

who can help me ?

Thank you very much!

Karl Seguin

unread,
Oct 13, 2011, 2:52:39 AM10/13/11
to mongod...@googlegroups.com
You can run a .js file pretty easily in the shell:

cat blah.js
db.coll.createIndex({abc:1})


mongo blah.js


Karl

Reply all
Reply to author
Forward
0 new messages