public interface DatabaseService
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletableFuture<java.lang.Long> |
countDocuments(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
CountOptions options)
Count documents
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
createCollection(java.lang.String name)
Lets the vault owner create a collection on database.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
deleteCollection(java.lang.String name)
Lets the vault owner delete a collection on database according to collection name.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
deleteMany(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode filter)
Delete many existing documents in a given collection
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
deleteOne(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode filter)
Delete an existing document in a given collection
|
java.util.concurrent.CompletableFuture<java.util.List<com.fasterxml.jackson.databind.JsonNode>> |
findMany(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
FindOptions options)
Find many documents
|
java.util.concurrent.CompletableFuture<com.fasterxml.jackson.databind.JsonNode> |
findOne(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
FindOptions options)
Find a specific document
|
java.util.concurrent.CompletableFuture<InsertResult> |
insertMany(java.lang.String collection,
java.util.List<com.fasterxml.jackson.databind.JsonNode> docs,
InsertOptions options)
Insert many new documents in a given collection
|
java.util.concurrent.CompletableFuture<InsertResult> |
insertOne(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode doc,
InsertOptions options)
Insert a new document in a given collection
|
java.util.concurrent.CompletableFuture<java.util.List<com.fasterxml.jackson.databind.JsonNode>> |
query(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
QueryOptions options)
Find many documents by many options.
|
java.util.concurrent.CompletableFuture<UpdateResult> |
updateMany(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode filter,
com.fasterxml.jackson.databind.JsonNode update,
UpdateOptions options)
Update many existing documents in a given collection
|
java.util.concurrent.CompletableFuture<UpdateResult> |
updateOne(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode filter,
com.fasterxml.jackson.databind.JsonNode update,
UpdateOptions options)
Update an existing document in a given collection
|
java.util.concurrent.CompletableFuture<java.lang.Void> createCollection(java.lang.String name)
name - the collection namejava.util.concurrent.CompletableFuture<java.lang.Void> deleteCollection(java.lang.String name)
name - the collection namejava.util.concurrent.CompletableFuture<InsertResult> insertOne(java.lang.String collection, com.fasterxml.jackson.databind.JsonNode doc, InsertOptions options)
collection - the collection namedoc - The document to insert. Must be a mutable mapping type. If
the document does not have an _id field one will be added automaticallyoptions - bypass_document_validation: (optional) If True, allows
the write to opt-out of document level validation. Default is False.InsertResult wrapperjava.util.concurrent.CompletableFuture<InsertResult> insertMany(java.lang.String collection, java.util.List<com.fasterxml.jackson.databind.JsonNode> docs, InsertOptions options)
collection - the collection namedocs - The document to insert. Must be a mutable mapping type. If the
document does not have an _id field one will be added automatically.options - ordered (optional): If True (the default) documents will be inserted on the server serially,
in the order provided. If an error occurs all remaining inserts are aborted. If False, documents
will be inserted on the server in arbitrary order, possibly in parallel, and all document inserts will be attempted.
bypass_document_validation: (optional) If True, allows the write to opt-out of document level validation. Default is False.InsertResult wrapperjava.util.concurrent.CompletableFuture<java.lang.Long> countDocuments(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
CountOptions options)
collection - the collection namequery - The document of filteroptions - skip (int): The number of matching documents to skip before returning results.
limit (int): The maximum number of documents to count. Must be a positive integer. If not provided, no limit is imposed.
maxTimeMS (int): The maximum amount of time to allow this operation to run, in milliseconds.java.util.concurrent.CompletableFuture<com.fasterxml.jackson.databind.JsonNode> findOne(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
FindOptions options)
collection - the collection namequery - optional, a JSON object specifying elements which must be present for a document to be included in the result setoptions - optional,refer to FindOptionsjava.util.concurrent.CompletableFuture<java.util.List<com.fasterxml.jackson.databind.JsonNode>> findMany(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
FindOptions options)
collection - the collection namequery - optional, a JSON object specifying elements which must be present for a document to be included in the result setoptions - optional,refer to FindOptionsjava.util.concurrent.CompletableFuture<java.util.List<com.fasterxml.jackson.databind.JsonNode>> query(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode query,
QueryOptions options)
collection - the collection namequery - optional, a JSON object specifying elements which must be present for a document to be included in the result setoptions - optional,refer to QueryOptionsjava.util.concurrent.CompletableFuture<UpdateResult> updateOne(java.lang.String collection, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options)
collection - the collection namefilter - A query that matches the document to update.update - The modifications to apply.options - optional, refer to UpdateOptionsUpdateResult wrapperjava.util.concurrent.CompletableFuture<UpdateResult> updateMany(java.lang.String collection, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options)
collection - the collection namefilter - A query that matches the document to update.update - The modifications to apply.options - optional, refer to UpdateOptionsUpdateResult wrapperjava.util.concurrent.CompletableFuture<java.lang.Void> deleteOne(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode filter)
collection - the collection namefilter - A query that matches the document to delete.java.util.concurrent.CompletableFuture<java.lang.Void> deleteMany(java.lang.String collection,
com.fasterxml.jackson.databind.JsonNode filter)
collection - the collection namefilter - A query that matches the document to delete.