Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-761

Allow LINQ lambda expressions to be used for queries in .Remove and .Update operations

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None

    Description

      The Query and Query<T> API's that we have to use for Update and Remove operations are pretty verbose and annoying to work with. It would be great to be able to use lambda expressions instead.

      E.g. instead of

      coll.Update(Query.Or(Query.EQ("Id", "..."), Query.EQ("Name", "John")), update)

      we could do

      coll.Update(o => o.Id == "..." || o.Name == "John", update)

      Same for Remove.

      Pull request is on it's way...

      Attachments

        Activity

          People

            Unassigned Unassigned
            eeg@trustpilot.com Einar Egilsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: