@Test
  void update() {
    WriteResult result1 = repository.update(person.id.is("aaa")).set(person.fullName, "name1").execute();
    check(result1.updatedCount().getAsLong()).is(0L);
    check(result1.insertedCount().getAsLong()).is(0L);
    check(result1.deletedCount().getAsLong()).is(0L);

    ImmutablePerson person1 = generator.next();
    repository.insert(person1);

    WriteResult result2 = repository.update(person.id.is(person1.id())).set(person.fullName, "name2").execute();
    check(result2.updatedCount().getAsLong()).is(1L);
    check(result2.insertedCount().getAsLong()).is(0L);
    check(result2.deletedCount().getAsLong()).is(0L);
  }
Validate results of a mongo write operation with {@link WriteResult}.
criteria/mongo/test/org/immutables/criteria/mongo/MongoWriteResultTest.java