protected final FluentFuture<Integer> doUpdateFirst(
            final Constraints.ConstraintHost criteria,
            final Constraints.Constraint update,
            final FindOneAndUpdateOptions options
    ) {
      checkNotNull(criteria, "criteria");
      checkNotNull(update, "update");
      checkNotNull(options, "options");

      return submit(new Callable<Integer>() {
        @Override
        public Integer call() {
          T result = collection().findOneAndUpdate(
                  convertToBson(criteria),
                  convertToBson(update),
                  options);

          return result == null ? 0 : 1;
        }
      });
    }
Codec used for current collection type.
@return registry
mongo/src/org/immutables/mongo/repository/Repositories.java