@SuppressWarnings("deprecation") private <TResult> FindOperation<TResult> createFindOperation(final MongoNamespace findNamespace, final Bson filter, final Class<TResult> resultClass, final FindOptions options) { return new FindOperation<TResult>(findNamespace, codecRegistry.get(resultClass)) .filter(filter == null ? new BsonDocument() : filter.toBsonDocument(documentClass, codecRegistry)) .batchSize(options.getBatchSize()) .skip(options.getSkip()) .limit(options.getLimit()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS) .maxAwaitTime(options.getMaxAwaitTime(MILLISECONDS), MILLISECONDS) .modifiers(toBsonDocumentOrNull(options.getModifiers())) .projection(toBsonDocumentOrNull(options.getProjection())) .sort(toBsonDocumentOrNull(options.getSort())) .cursorType(options.getCursorType()) .noCursorTimeout(options.isNoCursorTimeout()) .oplogReplay(options.isOplogReplay()) .partial(options.isPartial()) .slaveOk(readPreference.isSlaveOk()) .collation(options.getCollation()) .comment(options.getComment()) .hint(toBsonDocumentOrNull(options.getHint())) .min(toBsonDocumentOrNull(options.getMin())) .max(toBsonDocumentOrNull(options.getMax())) .maxScan(options.getMaxScan()) .returnKey(options.isReturnKey()) .showRecordId(options.isShowRecordId()) .snapshot(options.isSnapshot()); }
.min(collection.wrapAllowNull(findOptions.getMin())) .max(collection.wrapAllowNull(findOptions.getMax())) .returnKey(findOptions.isReturnKey()) .showRecordId(findOptions.isShowRecordId());
@SuppressWarnings("deprecation") private <TResult> FindOperation<TResult> createFindOperation(final MongoNamespace findNamespace, final Bson filter, final Class<TResult> resultClass, final FindOptions options) { return new FindOperation<TResult>(findNamespace, codecRegistry.get(resultClass)) .filter(filter == null ? new BsonDocument() : filter.toBsonDocument(documentClass, codecRegistry)) .batchSize(options.getBatchSize()) .skip(options.getSkip()) .limit(options.getLimit()) .maxTime(options.getMaxTime(MILLISECONDS), MILLISECONDS) .maxAwaitTime(options.getMaxAwaitTime(MILLISECONDS), MILLISECONDS) .modifiers(toBsonDocumentOrNull(options.getModifiers())) .projection(toBsonDocumentOrNull(options.getProjection())) .sort(toBsonDocumentOrNull(options.getSort())) .cursorType(options.getCursorType()) .noCursorTimeout(options.isNoCursorTimeout()) .oplogReplay(options.isOplogReplay()) .partial(options.isPartial()) .slaveOk(readPreference.isSlaveOk()) .collation(options.getCollation()) .comment(options.getComment()) .hint(toBsonDocumentOrNull(options.getHint())) .min(toBsonDocumentOrNull(options.getMin())) .max(toBsonDocumentOrNull(options.getMax())) .maxScan(options.getMaxScan()) .returnKey(options.isReturnKey()) .showRecordId(options.isShowRecordId()) .snapshot(options.isSnapshot()); }
.min(collection.wrapAllowNull(findOptions.getMin())) .max(collection.wrapAllowNull(findOptions.getMax())) .returnKey(findOptions.isReturnKey()) .showRecordId(findOptions.isShowRecordId());