-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.4.3
-
Environment:using mongo csharp driver 2.4.3
When trying to parse the following query:
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
var f = Builders<collectionFoo>.Filter; var query = f.In("product", some.Products) & f.Gte("version", "1.0.0") & f.In("version", new List<BsonRegularExpression>() { new BsonRegularExpression("/^1.2.0/"), new BsonRegularExpression("/^1.1.3/") });
another ways
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
new BsonArray(some.versions.Select(x => new BsonRegularExpression(x))) new BsonArray(some.versions.Select(x => new RegEx(x)))
I wanted the following results.
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
{ "$match" : { "product" : { "$in" : [1, 2, 3, 4] }, "version" : { "$gte" : "1.0.0", "$in" : [/^1.2.0/, /^1.1.3/, .... ] }
But the result is ...
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
{ "$match" : { "product" : { "$in" : [1, 2, 3, 4] }, "version" : { "$gte" : "1.0.0", "$in" : ["/^1.2.0/", "/^1.1.3/", ....] }
using BsonRegularExpression in `$in` command
https://docs.mongodb.com/manual/reference/operator/query/in/
The $in operator can specify matching values using regular expressions of the form /pattern/. You cannot use $regex operator expressions inside an $in.
I want to use regex in '$in' command..
- is duplicated by
-
CSHARP-1906 Case insensitive search using $in clause in Linq expressions
- Closed