Expression not supported: Convert Error on linq3

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.19.0
    • Component/s: LINQ3
    • None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      I can do this like on linq2 but error on linq3

      public Task<long> UpdateEntityAsync(long id, Expression<Func<T, object>> exp, object value, Dictionary<string, object> update, MonTrans? monTrans = null, UpdateOptions? options = null)
      {
         var filter = Builders<T>.Filter.And(GetPkMatch(id), Builders<T>.Filter.Eq(exp, value));
         var res = await collection.UpdateOneAsync(filter, new BsonDocument("$set", new BsonDocument(update), options));
         return res.ModifiedCount;
      }

      I just need the object type can convert to well-known framework types and i can use by expression

       

       

      MongoDB Driver Version: 2.19.0

      MongoDB Version: 6.0 replica

              Assignee:
              Robert Stam
              Reporter:
              JiaWei He
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: