public interface MongoDataSource
Modifier and Type | Method and Description |
---|---|
MongoDataSource |
bulkInsert(java.lang.String collection,
java.util.List<io.vertx.core.json.JsonObject> documents,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)
Insert many documents into the collection.
|
MongoDataSource |
count(java.lang.String collection,
io.vertx.core.json.JsonObject query,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)
Count matching documents in a collection.
|
MongoDataSource |
createIndex(java.lang.String collection,
Index index,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)
Creates an index on the collection.
|
MongoDataSource |
deleteIndex(java.lang.String collection,
java.lang.String name,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)
Deletes an index.
|
MongoDataSource |
dropCollection(java.lang.String collection,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)
Drops the collection.
|
MongoDataSource |
find(java.lang.String collection,
io.vertx.core.json.JsonObject query,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<io.vertx.core.json.JsonObject>>> resultHandler)
Find matching documents in the specified collection
|
MongoDataSource |
listIndexes(java.lang.String collection,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonArray>> resultHandler)
List all indexes.
|
MongoDataSource |
removeDocuments(java.lang.String collection,
io.vertx.core.json.JsonObject query,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)
Remove matching documents in a collection.
|
MongoDataSource |
upsert(java.lang.String collection,
io.vertx.core.json.JsonObject document,
io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)
Insert or update a document into the collection.
|
MongoDataSource count(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)
collection
- the collectionquery
- query used to match documentsresultHandler
- will be provided with the number of matching documentsMongoDataSource find(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<io.vertx.core.json.JsonObject>>> resultHandler)
collection
- the collectionquery
- query used to match documentsresultHandler
- will be provided with list of documentsMongoDataSource upsert(java.lang.String collection, io.vertx.core.json.JsonObject document, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> resultHandler)
collection
- the collectiondocument
- The document to insert or update.resultHandler
- A handler to handle the AsnycResult which contains a String with the new id (insert), or
null (update).MongoDataSource bulkInsert(java.lang.String collection, java.util.List<io.vertx.core.json.JsonObject> documents, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)
collection
- the collectiondocuments
- A collection of resources to insert into the collection.resultHandler
- A handler to handle the AsnycResult which contains the number of inserted documents.MongoDataSource removeDocuments(java.lang.String collection, io.vertx.core.json.JsonObject query, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Long>> resultHandler)
collection
- the collectionquery
- A filter for the remove request.resultHandler
- A handler to handle the AsnycResult which contains the number of deleted entries.MongoDataSource dropCollection(java.lang.String collection, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)
collection
- The collection.resultHandler
- will be called when completeMongoDataSource listIndexes(java.lang.String collection, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonArray>> resultHandler)
collection
- The collection.resultHandler
- A handler which contains a JsonArray including indexes.MongoDataSource createIndex(java.lang.String collection, Index index, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)
collection
- The collection.resultHandler
- A handler which will be called when the index is created.MongoDataSource deleteIndex(java.lang.String collection, java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>> resultHandler)
collection
- The collection.name
- The name of the index which should be deleted.resultHandler
- A handler which will be called when the index is deleted.