I would like to have autocomplete feature that suggests keywords from database. If I use MongoDB and multikey index, I kind of already have these keywords in database, but can I access them somehow?
If I have following object in collection:
{
"title": "Some awesome title",
"keywords": [
"some",
"awesome",
"title"
]
}
And I have multikey index:
db.somecollection.ensureIndex({ "keywords" : 1 })
So index would contain following values:
"some"
"awesome"
"title"
If user enters "s" letter into autocomplete control, application should suggest "some" keyword. Can I search keywords from index or how should I do this?