Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-770

Unexpected behaviour of FindOneAndUpdate method

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 0.0.2
    • Component/s: CRUD
    • Labels:
      None

      I am using FindOneAndUpdate method to update the document. The document is getting updated in DB but when you do DecodeBytes() on SingleResult it giver err:

      mongo: no documents in result
      

      This is happening sometimes.

      result := coll.FindOneAndUpdate(context.TODO(), filter, update)    
      if _, err := result.DecodeBytes(); err != nil {        
           logger.Error(err)        
           return err    
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            sumit.tembe Sumit Tembe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: