I'm trying to use mongo db text search but I get the following msg error - no text index for Although you can see that there are text indexes in db.items. what's the problem? what is the command in mongoose?
> db.items.getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "db.items",
"name" : "_id_"
},
{
"v" : 1,
"key" : {
"type" : "text",
"color" : "text",
"category_A" : "text",
"category_B" : "text",
"category_C" : "text"
},
"ns" : "db.items",
"name" : "type_text_color_text_category_A_text_category_B_text_category_C_text",
"sparse" : false,
"background" : false
}
]
> db.items.runCommand( "text",{search:"D"})
{ "ok" : 0, "errmsg" : "no text index for: db.items" }