[CSHARP-1635] Create a filter builder method generic enough to allow multiple similar types to be used Created: 21/Apr/16 Updated: 17/May/16 Resolved: 16/May/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Chad Kreimendahl | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
We have a collection that stores many object types. While they're all rooted around the same base class, we occasionally want AND together FilterDefinitions from multiple related classes. It would be great to have a generic FilterBuilder that would allow the Anding' together of unique types of FilterDefinition types without getting angry. Previously we could
and get back a basic IMongoQuery, on which we could do some further things like sorting, etc. This let us have a series of logic points and inject find parameters for different types and get the expected result. Given that multiple types can reside in one collection (and thus could be supported in 1 FilterDefinition), there should be a less rigid method for cases where this is the desired outcome. It would be useful for it to work when using the "&" or "|" methods as well. |
| Comments |
| Comment by Chad Kreimendahl [ 17/May/16 ] |
|
In this event 1668 should work for us.... and PasswordEmail inherits from Email... which was what we wanted to get... the ability to query subtypes with ANDs |
| Comment by Craig Wilson [ 16/May/16 ] |
|
Hi Chad, The only way this will work in the new API is for each type to have a common base class and couple that with I'm going to close this one as won't fix, but link it to 1668. Craig |