From 9d8b40b79eb878f50534b9f6a400dd613870cd29 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Tue, 30 Jul 2019 10:13:17 +0200 Subject: [PATCH] fix: Search fails on casting ValueExpression * Search fails on some occasions when casting to StringValue or UntypedValue. * The Search engine probably is incosistent when it uses UntypedValue vs StringValue --- src/Spark.Mongo/Search/Searcher/MongoSearcher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spark.Mongo/Search/Searcher/MongoSearcher.cs b/src/Spark.Mongo/Search/Searcher/MongoSearcher.cs index 36993e405..ca3eff03f 100644 --- a/src/Spark.Mongo/Search/Searcher/MongoSearcher.cs +++ b/src/Spark.Mongo/Search/Searcher/MongoSearcher.cs @@ -216,7 +216,7 @@ private Criterium CloseCriterium(Criterium crit, string resourceType, int level) throw new ArgumentException(String.Format("None of the possible target resources support querying for parameter {0}", crit.ParamName)); } crit.Operator = Operator.IN; - crit.Operand = new ChoiceValue(allKeys.Select(k => new StringValue(k))); + crit.Operand = new ChoiceValue(allKeys.Select(k => new UntypedValue(k))); return crit; }