[CSHARP-4784] List<dynamic> does not work when Guids. Created: 10/Sep/23 Updated: 18/Sep/23 |
|
| Status: | Backlog |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Steven Rothwell | Assignee: | Boris Dogadov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have a thread in the MongoDB forum for this here: https://www.mongodb.com/community/forums/t/dynamic-variables-are-causing-issues/242663/4 To put the details here; I’m using MongoDB.Driver 2.21.0 in my .NET 7 API. I am trying to use reflection to dynamically return data. When I use `
or
and it correctly returns any documents that contain those values. But, if `field` is a Guid and `values` is
, then I get this error:
If `values` is
It correctly returns any documents that have that Guid in the `field`. The only difference is `List<dynamic>` vs `List<Guid>`. But in my case, it needs to be dynamic as I am using input to figure out what documents to filter out. |
| Comments |
| Comment by Steven Rothwell [ 14/Sep/23 ] | |||
|
I really appreciate you guys looking into this and providing a workaround! | |||
| Comment by Boris Dogadov [ 11/Sep/23 ] | |||
|
Hi stevens.rothwell@gmail.com Meanwhile to workaround this problem, please add this configuration to your startup code:
| |||
| Comment by PM Bot [ 10/Sep/23 ] | |||
|
Hi stevens.rothwell@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon. |