{
"_id" : ObjectId("5811b03d231d884982672ddd"),
"person-name" : "Bell, Lee Phillip",
"info" : {
"trivia" : [
"Mother-in-law of 'Colleen Bell (II)' (qv) and 'Maria Arena Bell' (qv).",
"Mother of actress 'Lauralee Bell' (qv), writer/producer 'Bradley Bell (I)' (qv) and TV executive 'William J. Bell Jr.' (qv)."
],
"birthnotes" : [
"Chicago, Illinois, USA"
],
"spouse" : [
"'William J. Bell' (qv) (October 1954 - 29 April 2005) (his death); 3 children"
],
"birthname" : [
"Phillip, Lee"
]
}
}
我想在包含“Opera”的字段“info”中找到。有没有人有想法?
答案 0 :(得分:0)
db.collection.ensureIndex({ "$**": "text" })
db.collection.find( {
$text: {
$search: "Opera",
$caseSensitive: true
}
}
);
使用mongo中的文本索引