Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
OSI-Califronia opened this issue Jan 25, 2019 · 1 comment

Comments

@OSI-Califronia
Copy link

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;
  }
@karianna karianna added this to the 4.0.0 milestone Jan 25, 2019
@karianna
Copy link
Contributor

Can you submit a proper PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants