[CSHARP-487] Add multiple fields search support for LINQ provider Created: 05/Jun/12  Updated: 20/Mar/14  Resolved: 13/Mar/13

Status: Closed
Project: C# Driver
Component/s: Feature Request
Affects Version/s: 1.4.2
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Roman Sydorenko Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-622 Add [MongoOldName("OldName")] attribu... Closed

 Description   

Since structure of the document might be changed (i.e. field name, single value property might become a collection), it would be nice to save backward compatibility with old records while supporting new ones. One of the way to achieve this is to add custom attributes that will map new property to the old one(s).
Example:

old version of the class: employee.Task
new version of the class: employee.Tasks

As a result "var query =
employees.AsQueryable<C>()
.Where(e => e.Tasks.Contains(someTask));" should be able to make search through old records searching Task field and new records searching Tasks field.



 Comments   
Comment by Roman Sydorenko [ 05/Jun/12 ]

Yes, sure, priority is up to you. Thank you for your feedback!

Comment by Craig Wilson [ 05/Jun/12 ]

Seems reasonable enough. We'll take it under consideration. Thanks for the proposal. Can we downgrade the priority of this from Critical to Minor? This doesn't seem like it would affect a majority of people.

Comment by Roman Sydorenko [ 05/Jun/12 ]

Using reflection. I think that corresponding fields of the class could be marked by custom attribute (i.e. [FieldToCheck("Task", typeof(string))]). Then driver could check the attribute and know about all field names/types that had been used before for the marked field (in our example, for the "Tasks" field).

Comment by Craig Wilson [ 05/Jun/12 ]

@Roman: How would you propose the driver know about the document structure change?

Generated at Wed Feb 07 21:36:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.