ruby on rails – "codeName": "NamespaceNotFound" when reIndex () mongodb

In the Mongodb document, there is no need to reindex. I've assumed that it should work by itself. Well how do I know?
But I still tried to reIndex () because I handle errors due to excessive use of memory! and required the index.

What is the right way?

in my Rails model:

Mymodel class
include Mongoid :: Document
include Mongoid :: Timestamps
field: title, type => string
field: done, type => boolean
field: due ,: type => String
belongs to: user,: classname => "Admin :: User"
index ({title: 1}, {unique: false, name: "title_index"})

Open Mongo in the terminal

use admin
switched to admin db
> db.todo.reIndex ()
"ok": 0,
"errmsg": "the collection does not exist",
"code": 26,
"codeName": "NamespaceNotFound"