io.vertx.rxjava.ext.mongo.MongoClient Maven / Gradle / Ivy
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.rxjava.ext.mongo;
import rx.Observable;
import rx.Single;
import io.vertx.rx.java.RxHelper;
import io.vertx.rx.java.WriteStreamSubscriber;
import io.vertx.rx.java.SingleOnSubscribeAdapter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;
/**
* A Vert.x service used to interact with MongoDB server instances.
*
* Some of the operations might change _id field of passed document.
*
*
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.mongo.MongoClient original} non RX-ified interface using Vert.x codegen.
*/
@RxGen(io.vertx.ext.mongo.MongoClient.class)
public class MongoClient {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MongoClient that = (MongoClient) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg __TYPE_ARG = new TypeArg<>( obj -> new MongoClient((io.vertx.ext.mongo.MongoClient) obj),
MongoClient::getDelegate
);
private final io.vertx.ext.mongo.MongoClient delegate;
public MongoClient(io.vertx.ext.mongo.MongoClient delegate) {
this.delegate = delegate;
}
public MongoClient(Object delegate) {
this.delegate = (io.vertx.ext.mongo.MongoClient)delegate;
}
public io.vertx.ext.mongo.MongoClient getDelegate() {
return delegate;
}
private static final TypeArg TYPE_ARG_0 = new TypeArg(o1 -> io.vertx.rxjava.ext.mongo.MongoGridFsClient.newInstance((io.vertx.ext.mongo.MongoGridFsClient)o1), o1 -> o1.getDelegate());
private static final TypeArg TYPE_ARG_1 = new TypeArg(o1 -> io.vertx.rxjava.ext.mongo.MongoGridFsClient.newInstance((io.vertx.ext.mongo.MongoGridFsClient)o1), o1 -> o1.getDelegate());
/**
* Create a Mongo client which maintains its own data source.
* @param vertx the Vert.x instance
* @param config the configuration
* @return the client
*/
public static io.vertx.rxjava.ext.mongo.MongoClient create(io.vertx.rxjava.core.Vertx vertx, io.vertx.core.json.JsonObject config) {
io.vertx.rxjava.ext.mongo.MongoClient ret = io.vertx.rxjava.ext.mongo.MongoClient.newInstance((io.vertx.ext.mongo.MongoClient)io.vertx.ext.mongo.MongoClient.create(vertx.getDelegate(), config));
return ret;
}
/**
* Create a Mongo client which shares its data source with any other Mongo clients created with the same
* data source name
* @param vertx the Vert.x instance
* @param config the configuration
* @param dataSourceName the data source name
* @return the client
*/
public static io.vertx.rxjava.ext.mongo.MongoClient createShared(io.vertx.rxjava.core.Vertx vertx, io.vertx.core.json.JsonObject config, java.lang.String dataSourceName) {
io.vertx.rxjava.ext.mongo.MongoClient ret = io.vertx.rxjava.ext.mongo.MongoClient.newInstance((io.vertx.ext.mongo.MongoClient)io.vertx.ext.mongo.MongoClient.createShared(vertx.getDelegate(), config, dataSourceName));
return ret;
}
/**
* Like {@link io.vertx.rxjava.ext.mongo.MongoClient#createShared} but with the default data source name
* @param vertx the Vert.x instance
* @param config the configuration
* @return the client
*/
public static io.vertx.rxjava.ext.mongo.MongoClient createShared(io.vertx.rxjava.core.Vertx vertx, io.vertx.core.json.JsonObject config) {
io.vertx.rxjava.ext.mongo.MongoClient ret = io.vertx.rxjava.ext.mongo.MongoClient.newInstance((io.vertx.ext.mongo.MongoClient)io.vertx.ext.mongo.MongoClient.createShared(vertx.getDelegate(), config));
return ret;
}
/**
* Save a document in the specified collection
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @return a future provided with the id if document didn't already have one
*/
public io.vertx.core.Future save(java.lang.String collection, io.vertx.core.json.JsonObject document) {
io.vertx.core.Future ret = delegate.save(collection, document).map(val -> val);
return ret;
}
/**
* Save a document in the specified collection
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @return a future provided with the id if document didn't already have one
*/
public rx.Single rxSave(java.lang.String collection, io.vertx.core.json.JsonObject document) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.save(collection, document).onComplete(fut);
}));
}
/**
* Save a document in the specified collection with the specified write option
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @param writeOption the write option to use
* @return a future provided with the id if document didn't already have one
*/
public io.vertx.core.Future saveWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption) {
io.vertx.core.Future ret = delegate.saveWithOptions(collection, document, writeOption).map(val -> val);
return ret;
}
/**
* Save a document in the specified collection with the specified write option
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @param writeOption the write option to use
* @return a future provided with the id if document didn't already have one
*/
public rx.Single rxSaveWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.saveWithOptions(collection, document, writeOption).onComplete(fut);
}));
}
/**
* Insert a document in the specified collection
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @return a future provided with the id if document didn't already have one
*/
public io.vertx.core.Future insert(java.lang.String collection, io.vertx.core.json.JsonObject document) {
io.vertx.core.Future ret = delegate.insert(collection, document).map(val -> val);
return ret;
}
/**
* Insert a document in the specified collection
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @return a future provided with the id if document didn't already have one
*/
public rx.Single rxInsert(java.lang.String collection, io.vertx.core.json.JsonObject document) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.insert(collection, document).onComplete(fut);
}));
}
/**
* Insert a document in the specified collection with the specified write option
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @param writeOption the write option to use
* @return a future provided with the id if document didn't already have one
*/
public io.vertx.core.Future insertWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption) {
io.vertx.core.Future ret = delegate.insertWithOptions(collection, document, writeOption).map(val -> val);
return ret;
}
/**
* Insert a document in the specified collection with the specified write option
*
* This operation might change _id field of document parameter
* @param collection the collection
* @param document the document
* @param writeOption the write option to use
* @return a future provided with the id if document didn't already have one
*/
public rx.Single rxInsertWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject document, io.vertx.ext.mongo.WriteOption writeOption) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.insertWithOptions(collection, document, writeOption).onComplete(fut);
}));
}
/**
* Update matching documents in the specified collection and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update used to describe how the documents will be updated
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public io.vertx.core.Future updateCollection(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update) {
io.vertx.core.Future ret = delegate.updateCollection(collection, query, update).map(val -> val);
return ret;
}
/**
* Update matching documents in the specified collection and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update used to describe how the documents will be updated
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public rx.Single rxUpdateCollection(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.updateCollection(collection, query, update).onComplete(fut);
}));
}
/**
* Use an aggregation pipeline to update documents in the specified collection and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update used to describe how the documents will be updated
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public io.vertx.core.Future updateCollection(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update) {
io.vertx.core.Future ret = delegate.updateCollection(collection, query, update).map(val -> val);
return ret;
}
/**
* Use an aggregation pipeline to update documents in the specified collection and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update used to describe how the documents will be updated
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public rx.Single rxUpdateCollection(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.updateCollection(collection, query, update).onComplete(fut);
}));
}
/**
* Update matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update used to describe how the documents will be updated
* @param options options to configure the update
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public io.vertx.core.Future updateCollectionWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options) {
io.vertx.core.Future ret = delegate.updateCollectionWithOptions(collection, query, update, options).map(val -> val);
return ret;
}
/**
* Update matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update used to describe how the documents will be updated
* @param options options to configure the update
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public rx.Single rxUpdateCollectionWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.UpdateOptions options) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.updateCollectionWithOptions(collection, query, update, options).onComplete(fut);
}));
}
/**
* Use an aggregation pipeline to update documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update aggregation pipeline used to describe how documents will be updated
* @param options options to configure the update
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public io.vertx.core.Future updateCollectionWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options) {
io.vertx.core.Future ret = delegate.updateCollectionWithOptions(collection, query, update, options).map(val -> val);
return ret;
}
/**
* Use an aggregation pipeline to update documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param update aggregation pipeline used to describe how documents will be updated
* @param options options to configure the update
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public rx.Single rxUpdateCollectionWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonArray update, io.vertx.ext.mongo.UpdateOptions options) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.updateCollectionWithOptions(collection, query, update, options).onComplete(fut);
}));
}
/**
* Replace matching documents in the specified collection and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param replace all matching documents will be replaced with this
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public io.vertx.core.Future replaceDocuments(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace) {
io.vertx.core.Future ret = delegate.replaceDocuments(collection, query, replace).map(val -> val);
return ret;
}
/**
* Replace matching documents in the specified collection and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param replace all matching documents will be replaced with this
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public rx.Single rxReplaceDocuments(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.replaceDocuments(collection, query, replace).onComplete(fut);
}));
}
/**
* Replace matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param replace all matching documents will be replaced with this
* @param options options to configure the replace
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public io.vertx.core.Future replaceDocumentsWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options) {
io.vertx.core.Future ret = delegate.replaceDocumentsWithOptions(collection, query, replace, options).map(val -> val);
return ret;
}
/**
* Replace matching documents in the specified collection, specifying options and return the handler with MongoClientUpdateResult
result
* @param collection the collection
* @param query query used to match the documents
* @param replace all matching documents will be replaced with this
* @param options options to configure the replace
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientUpdateResult} when complete
*/
public rx.Single rxReplaceDocumentsWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.UpdateOptions options) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.replaceDocumentsWithOptions(collection, query, replace, options).onComplete(fut);
}));
}
/**
* Execute a bulk operation. Can insert, update, replace, and/or delete multiple documents with one request.
* @param collection the collection
* @param operations the operations to execute
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientBulkWriteResult} when complete
*/
public io.vertx.core.Future bulkWrite(java.lang.String collection, java.util.List operations) {
io.vertx.core.Future ret = delegate.bulkWrite(collection, operations).map(val -> val);
return ret;
}
/**
* Execute a bulk operation. Can insert, update, replace, and/or delete multiple documents with one request.
* @param collection the collection
* @param operations the operations to execute
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientBulkWriteResult} when complete
*/
public rx.Single rxBulkWrite(java.lang.String collection, java.util.List operations) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.bulkWrite(collection, operations).onComplete(fut);
}));
}
/**
* Execute a bulk operation with the specified write options. Can insert, update, replace, and/or delete multiple
* documents with one request.
* @param collection the collection
* @param operations the operations to execute
* @param bulkWriteOptions the write options
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientBulkWriteResult} when complete
*/
public io.vertx.core.Future bulkWriteWithOptions(java.lang.String collection, java.util.List operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions) {
io.vertx.core.Future ret = delegate.bulkWriteWithOptions(collection, operations, bulkWriteOptions).map(val -> val);
return ret;
}
/**
* Execute a bulk operation with the specified write options. Can insert, update, replace, and/or delete multiple
* documents with one request.
* @param collection the collection
* @param operations the operations to execute
* @param bulkWriteOptions the write options
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientBulkWriteResult} when complete
*/
public rx.Single rxBulkWriteWithOptions(java.lang.String collection, java.util.List operations, io.vertx.ext.mongo.BulkWriteOptions bulkWriteOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.bulkWriteWithOptions(collection, operations, bulkWriteOptions).onComplete(fut);
}));
}
/**
* Find matching documents in the specified collection
* @param collection the collection
* @param query query used to match documents
* @return a future provided with list of documents
*/
public io.vertx.core.Future> find(java.lang.String collection, io.vertx.core.json.JsonObject query) {
io.vertx.core.Future> ret = delegate.find(collection, query).map(val -> val);
return ret;
}
/**
* Find matching documents in the specified collection
* @param collection the collection
* @param query query used to match documents
* @return a future provided with list of documents
*/
public rx.Single> rxFind(java.lang.String collection, io.vertx.core.json.JsonObject query) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.find(collection, query).onComplete(fut);
}));
}
/**
* Find matching documents in the specified collection.
* This method use batchCursor for returning each found document.
* @param collection the collection
* @param query query used to match documents
* @return a emitting found documents
*/
public io.vertx.rxjava.core.streams.ReadStream findBatch(java.lang.String collection, io.vertx.core.json.JsonObject query) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.findBatch(collection, query), TypeArg.unknown());
return ret;
}
/**
* Find matching documents in the specified collection, specifying options
* @param collection the collection
* @param query query used to match documents
* @param options options to configure the find
* @return a future provided with list of documents
*/
public io.vertx.core.Future> findWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options) {
io.vertx.core.Future> ret = delegate.findWithOptions(collection, query, options).map(val -> val);
return ret;
}
/**
* Find matching documents in the specified collection, specifying options
* @param collection the collection
* @param query query used to match documents
* @param options options to configure the find
* @return a future provided with list of documents
*/
public rx.Single> rxFindWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findWithOptions(collection, query, options).onComplete(fut);
}));
}
/**
* Find matching documents in the specified collection, specifying options.
* This method use batchCursor for returning each found document.
* @param collection the collection
* @param query query used to match documents
* @param options options to configure the find
* @return a emitting found documents
*/
public io.vertx.rxjava.core.streams.ReadStream findBatchWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions options) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.findBatchWithOptions(collection, query, options), TypeArg.unknown());
return ret;
}
/**
* Find a single matching document in the specified collection
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param fields the fields
* @return a future provided with the document, if any
*/
public io.vertx.core.Future findOne(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields) {
io.vertx.core.Future ret = delegate.findOne(collection, query, fields).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param fields the fields
* @return a future provided with the document, if any
*/
public rx.Single rxFindOne(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject fields) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOne(collection, query, fields).onComplete(fut);
}));
}
/**
* Find a single matching document in the specified collection and update it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param update used to describe how the documents will be updated
* @return a future provided with the document, if any
*/
public io.vertx.core.Future findOneAndUpdate(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update) {
io.vertx.core.Future ret = delegate.findOneAndUpdate(collection, query, update).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection and update it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param update used to describe how the documents will be updated
* @return a future provided with the document, if any
*/
public rx.Single rxFindOneAndUpdate(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOneAndUpdate(collection, query, update).onComplete(fut);
}));
}
/**
* Find a single matching document in the specified collection and update it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param update used to describe how the documents will be updated
* @param findOptions options to configure the find
* @param updateOptions options to configure the update
* @return a future provided with the document, if any
*/
public io.vertx.core.Future findOneAndUpdateWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions) {
io.vertx.core.Future ret = delegate.findOneAndUpdateWithOptions(collection, query, update, findOptions, updateOptions).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection and update it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param update used to describe how the documents will be updated
* @param findOptions options to configure the find
* @param updateOptions options to configure the update
* @return a future provided with the document, if any
*/
public rx.Single rxFindOneAndUpdateWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject update, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOneAndUpdateWithOptions(collection, query, update, findOptions, updateOptions).onComplete(fut);
}));
}
/**
* Find a single matching document in the specified collection and replace it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param replace the replacement document
* @return a future provided with the document, if any
*/
public io.vertx.core.Future findOneAndReplace(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace) {
io.vertx.core.Future ret = delegate.findOneAndReplace(collection, query, replace).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection and replace it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param replace the replacement document
* @return a future provided with the document, if any
*/
public rx.Single rxFindOneAndReplace(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOneAndReplace(collection, query, replace).onComplete(fut);
}));
}
/**
* Find a single matching document in the specified collection and replace it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param replace the replacement document
* @param findOptions options to configure the find
* @param updateOptions options to configure the update
* @return a future provided with the document, if any
*/
public io.vertx.core.Future findOneAndReplaceWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions) {
io.vertx.core.Future ret = delegate.findOneAndReplaceWithOptions(collection, query, replace, findOptions, updateOptions).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection and replace it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param replace the replacement document
* @param findOptions options to configure the find
* @param updateOptions options to configure the update
* @return a future provided with the document, if any
*/
public rx.Single rxFindOneAndReplaceWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.json.JsonObject replace, io.vertx.ext.mongo.FindOptions findOptions, io.vertx.ext.mongo.UpdateOptions updateOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOneAndReplaceWithOptions(collection, query, replace, findOptions, updateOptions).onComplete(fut);
}));
}
/**
* Find a single matching document in the specified collection and delete it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @return a future provided with the deleted document, if any
*/
public io.vertx.core.Future findOneAndDelete(java.lang.String collection, io.vertx.core.json.JsonObject query) {
io.vertx.core.Future ret = delegate.findOneAndDelete(collection, query).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection and delete it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @return a future provided with the deleted document, if any
*/
public rx.Single rxFindOneAndDelete(java.lang.String collection, io.vertx.core.json.JsonObject query) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOneAndDelete(collection, query).onComplete(fut);
}));
}
/**
* Find a single matching document in the specified collection and delete it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param findOptions options to configure the find
* @return a future provided with the deleted document, if any
*/
public io.vertx.core.Future findOneAndDeleteWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions) {
io.vertx.core.Future ret = delegate.findOneAndDeleteWithOptions(collection, query, findOptions).map(val -> val);
return ret;
}
/**
* Find a single matching document in the specified collection and delete it.
*
* This operation might change _id field of query parameter
* @param collection the collection
* @param query the query used to match the document
* @param findOptions options to configure the find
* @return a future provided with the deleted document, if any
*/
public rx.Single rxFindOneAndDeleteWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.FindOptions findOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.findOneAndDeleteWithOptions(collection, query, findOptions).onComplete(fut);
}));
}
/**
* Count matching documents in a collection.
* @param collection the collection
* @param query query used to match documents
* @return a future provided with the number of matching documents
*/
public io.vertx.core.Future count(java.lang.String collection, io.vertx.core.json.JsonObject query) {
io.vertx.core.Future ret = delegate.count(collection, query).map(val -> val);
return ret;
}
/**
* Count matching documents in a collection.
* @param collection the collection
* @param query query used to match documents
* @return a future provided with the number of matching documents
*/
public rx.Single rxCount(java.lang.String collection, io.vertx.core.json.JsonObject query) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.count(collection, query).onComplete(fut);
}));
}
/**
* Count matching documents in a collection.
* @param collection the collection
* @param query query used to match documents
* @param countOptions
* @return a future provided with the number of matching documents
*/
public io.vertx.core.Future countWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions) {
io.vertx.core.Future ret = delegate.countWithOptions(collection, query, countOptions).map(val -> val);
return ret;
}
/**
* Count matching documents in a collection.
* @param collection the collection
* @param query query used to match documents
* @param countOptions
* @return a future provided with the number of matching documents
*/
public rx.Single rxCountWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.CountOptions countOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.countWithOptions(collection, query, countOptions).onComplete(fut);
}));
}
/**
* Remove matching documents from a collection and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match documents
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public io.vertx.core.Future removeDocuments(java.lang.String collection, io.vertx.core.json.JsonObject query) {
io.vertx.core.Future ret = delegate.removeDocuments(collection, query).map(val -> val);
return ret;
}
/**
* Remove matching documents from a collection and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match documents
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public rx.Single rxRemoveDocuments(java.lang.String collection, io.vertx.core.json.JsonObject query) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.removeDocuments(collection, query).onComplete(fut);
}));
}
/**
* Remove matching documents from a collection with the specified write option and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match documents
* @param writeOption the write option to use
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public io.vertx.core.Future removeDocumentsWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption) {
io.vertx.core.Future ret = delegate.removeDocumentsWithOptions(collection, query, writeOption).map(val -> val);
return ret;
}
/**
* Remove matching documents from a collection with the specified write option and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match documents
* @param writeOption the write option to use
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public rx.Single rxRemoveDocumentsWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.removeDocumentsWithOptions(collection, query, writeOption).onComplete(fut);
}));
}
/**
* Remove a single matching document from a collection and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match document
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public io.vertx.core.Future removeDocument(java.lang.String collection, io.vertx.core.json.JsonObject query) {
io.vertx.core.Future ret = delegate.removeDocument(collection, query).map(val -> val);
return ret;
}
/**
* Remove a single matching document from a collection and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match document
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public rx.Single rxRemoveDocument(java.lang.String collection, io.vertx.core.json.JsonObject query) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.removeDocument(collection, query).onComplete(fut);
}));
}
/**
* Remove a single matching document from a collection with the specified write option and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match document
* @param writeOption the write option to use
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public io.vertx.core.Future removeDocumentWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption) {
io.vertx.core.Future ret = delegate.removeDocumentWithOptions(collection, query, writeOption).map(val -> val);
return ret;
}
/**
* Remove a single matching document from a collection with the specified write option and return the handler with MongoClientDeleteResult
result
* @param collection the collection
* @param query query used to match document
* @param writeOption the write option to use
* @return a future notified with a {@link io.vertx.ext.mongo.MongoClientDeleteResult} when complete
*/
public rx.Single rxRemoveDocumentWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.WriteOption writeOption) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.removeDocumentWithOptions(collection, query, writeOption).onComplete(fut);
}));
}
/**
* Create a new collection
* @param collectionName the name of the collection
* @return a future notified once complete
*/
public io.vertx.core.Future createCollection(java.lang.String collectionName) {
io.vertx.core.Future ret = delegate.createCollection(collectionName).map(val -> val);
return ret;
}
/**
* Create a new collection
* @param collectionName the name of the collection
* @return a future notified once complete
*/
public rx.Single rxCreateCollection(java.lang.String collectionName) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createCollection(collectionName).onComplete(fut);
}));
}
/**
* Create a new collection with options
* @param collectionName the name of the collection
* @param collectionOptions options of the collection
* @return a future notified once complete
*/
public io.vertx.core.Future createCollectionWithOptions(java.lang.String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions) {
io.vertx.core.Future ret = delegate.createCollectionWithOptions(collectionName, collectionOptions).map(val -> val);
return ret;
}
/**
* Create a new collection with options
* @param collectionName the name of the collection
* @param collectionOptions options of the collection
* @return a future notified once complete
*/
public rx.Single rxCreateCollectionWithOptions(java.lang.String collectionName, io.vertx.ext.mongo.CreateCollectionOptions collectionOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createCollectionWithOptions(collectionName, collectionOptions).onComplete(fut);
}));
}
/**
* Get a list of all collections in the database.
* @return a future notified with a list of collections.
*/
public io.vertx.core.Future> getCollections() {
io.vertx.core.Future> ret = delegate.getCollections().map(val -> val);
return ret;
}
/**
* Get a list of all collections in the database.
* @return a future notified with a list of collections.
*/
public rx.Single> rxGetCollections() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.getCollections().onComplete(fut);
}));
}
/**
* Drop a collection
* @param collection the collection
* @return a future notified when complete
*/
public io.vertx.core.Future dropCollection(java.lang.String collection) {
io.vertx.core.Future ret = delegate.dropCollection(collection).map(val -> val);
return ret;
}
/**
* Drop a collection
* @param collection the collection
* @return a future notified when complete
*/
public rx.Single rxDropCollection(java.lang.String collection) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.dropCollection(collection).onComplete(fut);
}));
}
/**
* Rename a collection
* @param oldCollectionName the name of the collection
* @param newCollectionName the new name of the collection
* @return a future notified when complete
*/
public io.vertx.core.Future renameCollection(java.lang.String oldCollectionName, java.lang.String newCollectionName) {
io.vertx.core.Future ret = delegate.renameCollection(oldCollectionName, newCollectionName).map(val -> val);
return ret;
}
/**
* Rename a collection
* @param oldCollectionName the name of the collection
* @param newCollectionName the new name of the collection
* @return a future notified when complete
*/
public rx.Single rxRenameCollection(java.lang.String oldCollectionName, java.lang.String newCollectionName) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.renameCollection(oldCollectionName, newCollectionName).onComplete(fut);
}));
}
/**
* Rename a collection
* @param oldCollectionName the name of the collection
* @param newCollectionName the new name of the collection
* @param collectionOptions options of the collection
* @return a future notified when complete
*/
public io.vertx.core.Future renameCollectionWithOptions(java.lang.String oldCollectionName, java.lang.String newCollectionName, io.vertx.ext.mongo.RenameCollectionOptions collectionOptions) {
io.vertx.core.Future ret = delegate.renameCollectionWithOptions(oldCollectionName, newCollectionName, collectionOptions).map(val -> val);
return ret;
}
/**
* Rename a collection
* @param oldCollectionName the name of the collection
* @param newCollectionName the new name of the collection
* @param collectionOptions options of the collection
* @return a future notified when complete
*/
public rx.Single rxRenameCollectionWithOptions(java.lang.String oldCollectionName, java.lang.String newCollectionName, io.vertx.ext.mongo.RenameCollectionOptions collectionOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.renameCollectionWithOptions(oldCollectionName, newCollectionName, collectionOptions).onComplete(fut);
}));
}
/**
* Creates an index.
* @param collection the collection
* @param key A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.
* @return a future notified when complete
*/
public io.vertx.core.Future createIndex(java.lang.String collection, io.vertx.core.json.JsonObject key) {
io.vertx.core.Future ret = delegate.createIndex(collection, key).map(val -> val);
return ret;
}
/**
* Creates an index.
* @param collection the collection
* @param key A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.
* @return a future notified when complete
*/
public rx.Single rxCreateIndex(java.lang.String collection, io.vertx.core.json.JsonObject key) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createIndex(collection, key).onComplete(fut);
}));
}
/**
* Creates an index.
* @param collection the collection
* @param key A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.
* @param options the options for the index
* @return a future notified when complete
*/
public io.vertx.core.Future createIndexWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options) {
io.vertx.core.Future ret = delegate.createIndexWithOptions(collection, key, options).map(val -> val);
return ret;
}
/**
* Creates an index.
* @param collection the collection
* @param key A document that contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.
* @param options the options for the index
* @return a future notified when complete
*/
public rx.Single rxCreateIndexWithOptions(java.lang.String collection, io.vertx.core.json.JsonObject key, io.vertx.ext.mongo.IndexOptions options) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createIndexWithOptions(collection, key, options).onComplete(fut);
}));
}
/**
* creates an indexes
* @param collection the collection
* @param indexes A model that contains pairs of document and indexOptions, document contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.
* @return a future notified when complete
*/
public io.vertx.core.Future createIndexes(java.lang.String collection, java.util.List indexes) {
io.vertx.core.Future ret = delegate.createIndexes(collection, indexes).map(val -> val);
return ret;
}
/**
* creates an indexes
* @param collection the collection
* @param indexes A model that contains pairs of document and indexOptions, document contains the field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of 1; for descending index, specify a value of -1.
* @return a future notified when complete
*/
public rx.Single rxCreateIndexes(java.lang.String collection, java.util.List indexes) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createIndexes(collection, indexes).onComplete(fut);
}));
}
/**
* Get all the indexes in this collection.
* @param collection the collection
* @return a future notified when complete
*/
public io.vertx.core.Future listIndexes(java.lang.String collection) {
io.vertx.core.Future ret = delegate.listIndexes(collection).map(val -> val);
return ret;
}
/**
* Get all the indexes in this collection.
* @param collection the collection
* @return a future notified when complete
*/
public rx.Single rxListIndexes(java.lang.String collection) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.listIndexes(collection).onComplete(fut);
}));
}
/**
* Drops the index given its name.
* @param collection the collection
* @param indexName the name of the index to remove
* @return a future notified when complete
*/
public io.vertx.core.Future dropIndex(java.lang.String collection, java.lang.String indexName) {
io.vertx.core.Future ret = delegate.dropIndex(collection, indexName).map(val -> val);
return ret;
}
/**
* Drops the index given its name.
* @param collection the collection
* @param indexName the name of the index to remove
* @return a future notified when complete
*/
public rx.Single rxDropIndex(java.lang.String collection, java.lang.String indexName) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.dropIndex(collection, indexName).onComplete(fut);
}));
}
/**
* Drops the index given the keys used to create it.
* @param collection the collection
* @param key the key(s) of the index to remove
* @return a future notified when complete
*/
public io.vertx.core.Future dropIndex(java.lang.String collection, io.vertx.core.json.JsonObject key) {
io.vertx.core.Future ret = delegate.dropIndex(collection, key).map(val -> val);
return ret;
}
/**
* Drops the index given the keys used to create it.
* @param collection the collection
* @param key the key(s) of the index to remove
* @return a future notified when complete
*/
public rx.Single rxDropIndex(java.lang.String collection, io.vertx.core.json.JsonObject key) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.dropIndex(collection, key).onComplete(fut);
}));
}
/**
* Run an arbitrary MongoDB command.
* @param commandName the name of the command
* @param command the command
* @return a future notified with the result.
*/
public io.vertx.core.Future runCommand(java.lang.String commandName, io.vertx.core.json.JsonObject command) {
io.vertx.core.Future ret = delegate.runCommand(commandName, command).map(val -> val);
return ret;
}
/**
* Run an arbitrary MongoDB command.
* @param commandName the name of the command
* @param command the command
* @return a future notified with the result.
*/
public rx.Single rxRunCommand(java.lang.String commandName, io.vertx.core.json.JsonObject command) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.runCommand(commandName, command).onComplete(fut);
}));
}
/**
* Gets the distinct values of the specified field name.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @return a future provided with array of values.
*/
public io.vertx.core.Future distinct(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname) {
io.vertx.core.Future ret = delegate.distinct(collection, fieldName, resultClassname).map(val -> val);
return ret;
}
/**
* Gets the distinct values of the specified field name.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @return a future provided with array of values.
*/
public rx.Single rxDistinct(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.distinct(collection, fieldName, resultClassname).onComplete(fut);
}));
}
/**
* Gets the distinct values of the specified field name.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param distinctOptions options (e.g. collation)
* @return a future provided with array of values.
*/
public io.vertx.core.Future distinct(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
io.vertx.core.Future ret = delegate.distinct(collection, fieldName, resultClassname, distinctOptions).map(val -> val);
return ret;
}
/**
* Gets the distinct values of the specified field name.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param distinctOptions options (e.g. collation)
* @return a future provided with array of values.
*/
public rx.Single rxDistinct(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.distinct(collection, fieldName, resultClassname, distinctOptions).onComplete(fut);
}));
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @return a future provided with array of values.
*/
public io.vertx.core.Future distinctWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query) {
io.vertx.core.Future ret = delegate.distinctWithQuery(collection, fieldName, resultClassname, query).map(val -> val);
return ret;
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @return a future provided with array of values.
*/
public rx.Single rxDistinctWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.distinctWithQuery(collection, fieldName, resultClassname, query).onComplete(fut);
}));
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @param distinctOptions options (e.g. collation)
* @return a future provided with array of values.
*/
public io.vertx.core.Future distinctWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
io.vertx.core.Future ret = delegate.distinctWithQuery(collection, fieldName, resultClassname, query, distinctOptions).map(val -> val);
return ret;
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* Return a JsonArray containing distinct values (eg: [ 1 , 89 ])
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @param distinctOptions options (e.g. collation)
* @return a future provided with array of values.
*/
public rx.Single rxDistinctWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.distinctWithQuery(collection, fieldName, resultClassname, query, distinctOptions).onComplete(fut);
}));
}
/**
* Gets the distinct values of the specified field name.
* This method use batchCursor for returning each found value.
* Each value is a json fragment with fieldName key (eg: {"num": 1}).
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @return a emitting json fragments
*/
public io.vertx.rxjava.core.streams.ReadStream distinctBatch(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.distinctBatch(collection, fieldName, resultClassname), TypeArg.unknown());
return ret;
}
/**
* Gets the distinct values of the specified field name.
* This method use batchCursor for returning each found value.
* Each value is a json fragment with fieldName key (eg: {"num": 1}).
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param distinctOptions options (e.g. collation)
* @return a emitting json fragments
*/
public io.vertx.rxjava.core.streams.ReadStream distinctBatch(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.distinctBatch(collection, fieldName, resultClassname, distinctOptions), TypeArg.unknown());
return ret;
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* This method use batchCursor for returning each found value.
* Each value is a json fragment with fieldName key (eg: {"num": 1}).
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @return a emitting json fragments
*/
public io.vertx.rxjava.core.streams.ReadStream distinctBatchWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.distinctBatchWithQuery(collection, fieldName, resultClassname, query), TypeArg.unknown());
return ret;
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* This method use batchCursor for returning each found value.
* Each value is a json fragment with fieldName key (eg: {"num": 1}).
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @param distinctOptions options (e.g. collation)
* @return a emitting json fragments
*/
public io.vertx.rxjava.core.streams.ReadStream distinctBatchWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.distinctBatchWithQuery(collection, fieldName, resultClassname, query, distinctOptions), TypeArg.unknown());
return ret;
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* This method use batchCursor for returning each found value.
* Each value is a json fragment with fieldName key (eg: {"num": 1}).
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @param batchSize the number of documents to load in a batch
* @return a emitting json fragments
*/
public io.vertx.rxjava.core.streams.ReadStream distinctBatchWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query, int batchSize) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.distinctBatchWithQuery(collection, fieldName, resultClassname, query, batchSize), TypeArg.unknown());
return ret;
}
/**
* Gets the distinct values of the specified field name filtered by specified query.
* This method use batchCursor for returning each found value.
* Each value is a json fragment with fieldName key (eg: {"num": 1}).
* @param collection the collection
* @param fieldName the field name
* @param resultClassname
* @param query the query
* @param batchSize the number of documents to load in a batch
* @param distinctOptions options (e.g. collation)
* @return a emitting json fragments
*/
public io.vertx.rxjava.core.streams.ReadStream distinctBatchWithQuery(java.lang.String collection, java.lang.String fieldName, java.lang.String resultClassname, io.vertx.core.json.JsonObject query, int batchSize, io.vertx.ext.mongo.DistinctOptions distinctOptions) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.distinctBatchWithQuery(collection, fieldName, resultClassname, query, batchSize, distinctOptions), TypeArg.unknown());
return ret;
}
/**
* Run aggregate MongoDB command with default {@link io.vertx.ext.mongo.AggregateOptions}.
* @param collection the collection
* @param pipeline aggregation pipeline to be executed
* @return
*/
public io.vertx.rxjava.core.streams.ReadStream aggregate(java.lang.String collection, io.vertx.core.json.JsonArray pipeline) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.aggregate(collection, pipeline), TypeArg.unknown());
return ret;
}
/**
* Run aggregate MongoDB command.
* @param collection the collection
* @param pipeline aggregation pipeline to be executed
* @param options options to configure the aggregation command
* @return
*/
public io.vertx.rxjava.core.streams.ReadStream aggregateWithOptions(java.lang.String collection, io.vertx.core.json.JsonArray pipeline, io.vertx.ext.mongo.AggregateOptions options) {
io.vertx.rxjava.core.streams.ReadStream ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.aggregateWithOptions(collection, pipeline, options), TypeArg.unknown());
return ret;
}
/**
* Creates a {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} used to interact with Mongo GridFS.
* @return a future notified with the {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} to interact with the bucket named bucketName
*/
public io.vertx.core.Future createDefaultGridFsBucketService() {
io.vertx.core.Future ret = delegate.createDefaultGridFsBucketService().map(val -> io.vertx.rxjava.ext.mongo.MongoGridFsClient.newInstance((io.vertx.ext.mongo.MongoGridFsClient)val));
return ret;
}
/**
* Creates a {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} used to interact with Mongo GridFS.
* @return a future notified with the {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} to interact with the bucket named bucketName
*/
public rx.Single rxCreateDefaultGridFsBucketService() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createDefaultGridFsBucketService().onComplete(fut);
}));
}
/**
* Creates a {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} used to interact with Mongo GridFS.
* @param bucketName the name of the GridFS bucket
* @return a future notified with the {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} to interact with the bucket named bucketName
*/
public io.vertx.core.Future createGridFsBucketService(java.lang.String bucketName) {
io.vertx.core.Future ret = delegate.createGridFsBucketService(bucketName).map(val -> io.vertx.rxjava.ext.mongo.MongoGridFsClient.newInstance((io.vertx.ext.mongo.MongoGridFsClient)val));
return ret;
}
/**
* Creates a {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} used to interact with Mongo GridFS.
* @param bucketName the name of the GridFS bucket
* @return a future notified with the {@link io.vertx.rxjava.ext.mongo.MongoGridFsClient} to interact with the bucket named bucketName
*/
public rx.Single rxCreateGridFsBucketService(java.lang.String bucketName) {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.createGridFsBucketService(bucketName).onComplete(fut);
}));
}
/**
* Close the client and release its resources
* @return
*/
public io.vertx.core.Future close() {
io.vertx.core.Future ret = delegate.close().map(val -> val);
return ret;
}
/**
* Close the client and release its resources
* @return
*/
public rx.Single rxClose() {
return Single.create(new SingleOnSubscribeAdapter<>(fut -> {
this.close().onComplete(fut);
}));
}
/**
* Watch the collection change.
* @param collection the collection
* @param pipeline watching pipeline to be executed
* @param withUpdatedDoc whether to get updated fullDocument for "update" operation
* @param batchSize the number of documents to load in a batch
* @return
*/
public io.vertx.rxjava.core.streams.ReadStream> watch(java.lang.String collection, io.vertx.core.json.JsonArray pipeline, boolean withUpdatedDoc, int batchSize) {
io.vertx.rxjava.core.streams.ReadStream> ret = io.vertx.rxjava.core.streams.ReadStream.newInstance((io.vertx.core.streams.ReadStream)delegate.watch(collection, pipeline, withUpdatedDoc, batchSize), TypeArg.unknown());
return ret;
}
/**
* The name of the default pool
*/
public static final java.lang.String DEFAULT_POOL_NAME = io.vertx.ext.mongo.MongoClient.DEFAULT_POOL_NAME;
/**
* The name of the default database
*/
public static final java.lang.String DEFAULT_DB_NAME = io.vertx.ext.mongo.MongoClient.DEFAULT_DB_NAME;
public static MongoClient newInstance(io.vertx.ext.mongo.MongoClient arg) {
return arg != null ? new MongoClient(arg) : null;
}
}