protected final FluentFuture<Integer> doInsert(final ImmutableList<T> documents) {
      if (documents.isEmpty()) {
        return FluentFutures.from(Futures.immediateFuture(0));
      }
      return submit(new Callable<Integer>() {
        @Override
        public Integer call() {
          collection().insertMany(documents);
          return 0; // java driver for mongo returns 0 anyway
        }
      });
    }
Codec used for current collection type.
@return registry
mongo/src/org/immutables/mongo/repository/Repositories.java