vertx-mongo-client icon indicating copy to clipboard operation
vertx-mongo-client copied to clipboard

[3.6.2] MongoClientImpl findBatch does not transmit 'batchSize' param to FindIterable

Open OSI-Califronia opened this issue 6 years ago • 1 comments

I changed to code to this MongoClientImpl

 private FindIterable<JsonObject> doFind(String collection, JsonObject query, FindOptions options) {
    MongoCollection<JsonObject> coll = getCollection(collection);
    Bson bquery = wrap(encodeKeyWhenUseObjectId(query));
    FindIterable<JsonObject> find = coll.find(bquery, JsonObject.class);
    if (options.getBatchSize() > 0) {
      find.batchSize(options.getBatchSize());
    }
    if (options.getLimit() != -1) {
      find.limit(options.getLimit());
    }
    if (options.getSkip() > 0) {
      find.skip(options.getSkip());
    }
    if (options.getSort() != null) {
      find.sort(wrap(options.getSort()));
    }
    if (options.getFields() != null) {
      find.projection(wrap(options.getFields()));
    }
    return find;
  }

OSI-Califronia avatar Jan 25 '19 09:01 OSI-Califronia

Can you submit a proper PR for this?

karianna avatar Jan 25 '19 20:01 karianna