Use case:
insert this document in a collection:
{
title: "The adventure of Jane doe"
authors: [{ name: "john doe" }]
}
creating a multiple fields text index :
db.mycollection.createIndex({title: “text”, “authors.name”: “text”})
querying:
db.mycollection.find({$text: {$search: “jan” }})
returns the document
querying:
db.mycollection.find({$text: {$search: “joh”}})
doesn’t return anything
querying:
db.mycollection.find({$text: {$search: “john”}})
returns the document
It seems that search text doesn’t search prefix on array of documents
If anyone has an explanation, i would be very grateful