[CSHARP-495] The "In" operator matches the whole element in the input array. So a query with "In" with "Contains" is not possible. Created: 14/Jun/12 Updated: 04/May/20 Resolved: 04/May/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Feature Request |
| Affects Version/s: | 1.4.2 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Sunil Raj | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
software platform |
||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Please refer my question: ``Is there an option to perform the "In" operation on strings?`` for more details: There is no equivalent to this mongo query in c# driver to linq: The Predicatebuilder wraps the string content with double quotes, which affects the result. Please fix/ add this feature. Thanks.. |
| Comments |
| Comment by Sunil Raj [ 15/Jun/12 ] |
|
Thanks Craig for your input. I will implement the same and will be waiting too |
| Comment by Craig Wilson [ 15/Jun/12 ] |
|
You can always build the $in query manually as well while you are waiting. Syntax might be a little off here, but this should work. $in will use an index better than $or. new QueryDocument("fieldName", new BsonDocument }); |
| Comment by Sunil Raj [ 15/Jun/12 ] |
|
Craig, if (!string.IsNullOrEmpty(tags)) , StringSplitOptions.RemoveEmptyEntries).ToList(); List<IMongoQuery> queries = new List<IMongoQuery>(); var queriesArray = queries.ToArray(); //Here I am creating an array of IMongoQuery by iterating through the list of strings to be passed as query. This seems to be performing a bit slow though. So waiting for your update on the new feature. |
| Comment by Craig Wilson [ 14/Jun/12 ] |
|
I'm not sure I following your question: "I was wondering if this was possible using other options such as regular expressions". Could you please restate or clarify? |
| Comment by Sunil Raj [ 14/Jun/12 ] |
|
I was wondering if this was possible using other options such as regular expressions. Anyways, thanks for the update. Eagerly waiting for the feature. |
| Comment by Craig Wilson [ 14/Jun/12 ] |
|
I have changed this from a Bug to a Feature Request as the code is performing properly, we just haven't implemented this particular item. |