0
Robomongoでは、次のクエリが動作し、顧客名または国名に「Acushnet」が含まれているすべてのドキュメントが返されます。私の.NETの例でMongoDB .NET Driver 2.4マッチステージ
db.getCollection('plants').aggregate([
$match: {
$or :
[
{
'customerName.Name.value' : /Acushnet/
},
{
'country.CountryName' : /Acushnet/
}
]
}
])
、私は全く同じマッチステージを追加:
var matchStage = new BsonDocument
{
{
"$match", new BsonDocument
{
{
"$or", new BsonArray
{
new BsonDocument
{
{
"customerName.Name.value", "/" + term + "/"
}
},
new BsonDocument
{
{
"country.countryName", "/" + term + "/"
}
}
}
}
}
}
};
pipe.AppendStage<BsonDocument>(matchStage);
用語は、私の検索用語( 'アクシネット')のプレースホルダーです。私にとっては両方の例が同じですが、2番目の例はすべての文書を返します。最初のものは、Acushnetを含む4つのドキュメントのみを返します。
.NETドライバとRobomongoで送信するクエリが異なるのはなぜですか?