ClassCastException in FindAndUpdateOperation

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.11.1
    • Affects Version/s: 3.11.0
    • Component/s: Write Operations
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      toBsonValueList casts Bson objects to BsonValue which errors when the actual value is eg. a Document.

      MongoCollection<Document> collection = // ...
      
      Document existing = collection.findOneAndUpdate(
          new Document("_id", 1), 
          Collections.singletonList(
              new Document("$set", new Document("title", "The Burning White"))
          ),
          new FindOneAndUpdateOptions().upsert(true));
      

              Assignee:
              Jeffrey Yemin
              Reporter:
              Christoph Strobl
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: