1
MongoDBから検索結果を取得しようとしていますが、配列の配列をMogoDBドキュメントの特定のStringオブジェクトと照合しています。 私のサンプルMongoDbドキュメント。MongoDBの配列と文字列を一致させる
"Notedisp" : {
"NoteID" : NumberLong(100281),
"NoteTitle" : null,
"NoteContent" : "In mathematics, the Pythagorean theorem theorem, also known as Pythagoras's theorem, is a relation in Euclidean geometry among the three sides of a right triangle. It states that the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides. The theorem can be written as an equation relating the lengths of the sides a, b and c, often called the \"Pythagorean equation\"\r\n\r\na^2 + b^2 = c^2 ,\r\nwhere c represents the length of the hypotenuse and a and b the lengths of the triangle's other two sides.",
},
私はすでに次のコードを試しています。上記のコード「Notedisp.NoteContent」で
var listTearm = ["what","is","Pythagorean","theorem"]
var filter = (builder.AnyIn("Notedisp.NoteContent", listTearm)
はMongoDBのドキュメント内の文字列オブジェクトであり、それは、空の文字列を返します。それで、StringとMogoDbのドキュメントを一致させ、特定のデータを返すことができる特定の方法があります。単純化されたオブジェクトに
これは正しい軌道に乗るでしょうか? https://docs.mongodb.com/manual/reference/operator/query/text/#match-any-of-the-search-terms – dyouberg