public class DatabaseController
extends java.lang.Object
| Constructor and Description |
|---|
DatabaseController(NodeRPCConnection connection)
Create by the RPC connection.
|
| Modifier and Type | Method and Description |
|---|---|
long |
countDocuments(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
CountOptions options)
Count the documents by filter.
|
void |
createCollection(java.lang.String collectionName)
Create the collection.
|
void |
deleteCollection(java.lang.String collectionName)
Delete the collection by name.
|
int |
deleteMany(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
DeleteOptions options)
Delete all matched document by the filter.
|
int |
deleteOne(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
DeleteOptions options)
Delete the first matched document by the filter.
|
java.util.List<com.fasterxml.jackson.databind.JsonNode> |
find(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
FindOptions options)
Find all matched document by filter.
|
com.fasterxml.jackson.databind.JsonNode |
findOne(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
FindOptions options)
Find the first matched document by filter.
|
InsertResult |
insertMany(java.lang.String collectionName,
java.util.List<com.fasterxml.jackson.databind.JsonNode> documents,
InsertOptions options)
Insert many documents.
|
InsertResult |
insertOne(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode document,
InsertOptions options)
Insert one document.
|
java.util.List<com.fasterxml.jackson.databind.JsonNode> |
query(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
QueryOptions options)
Query the documents by filter and options.
|
UpdateResult |
updateMany(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
com.fasterxml.jackson.databind.JsonNode update,
UpdateOptions options)
Update all matched documents by the filter.
|
UpdateResult |
updateOne(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
com.fasterxml.jackson.databind.JsonNode update,
UpdateOptions options)
Update the first matched document by the filter.
|
public DatabaseController(NodeRPCConnection connection)
connection - The RPC connection.public void createCollection(java.lang.String collectionName)
throws HiveException
collectionName - The name of the collection.HiveException - The error comes from the hive node.public void deleteCollection(java.lang.String collectionName)
throws HiveException
collectionName - The name of the collection.HiveException - The error comes from the hive node.public InsertResult insertOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode document, InsertOptions options) throws HiveException
collectionName - The name of the collection.document - The document.options - Insert options.HiveException - The error comes from the hive node.public InsertResult insertMany(java.lang.String collectionName, java.util.List<com.fasterxml.jackson.databind.JsonNode> documents, InsertOptions options) throws HiveException
collectionName - The name of the collection.documents - The document.options - Insert options.HiveException - The error comes from the hive node.public UpdateResult updateOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options) throws HiveException
collectionName - The name of the collection.filter - The filter to filter the matched document.update - The update data.options - The update options.HiveException - The error comes from the hive node.public UpdateResult updateMany(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options) throws HiveException
collectionName - The name of the collection.filter - The filter to filter the matched document.update - The update data.options - The update options.HiveException - The error comes from the hive node.public int deleteOne(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
DeleteOptions options)
throws HiveException
collectionName - The name of the collection.filter - The filter to filter the matched document.options - The delete options.HiveException - The error comes from the hive node.public int deleteMany(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
DeleteOptions options)
throws HiveException
collectionName - The name of the collection.filter - The filter to filter the matched documents.options - The delete options.HiveException - The error comes from the hive node.public long countDocuments(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
CountOptions options)
throws HiveException
collectionName - The name of the collection.filter - The filter to match the documents.options - Count options.HiveException - The error comes from the hive node.public com.fasterxml.jackson.databind.JsonNode findOne(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
FindOptions options)
throws HiveException
collectionName - The name of the collection.filter - The filter to match the document.options - The find options.HiveException - The error comes from the hive node.public java.util.List<com.fasterxml.jackson.databind.JsonNode> find(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
FindOptions options)
throws HiveException
collectionName - The name of the collection.filter - The filter to match the documents.options - The find options.HiveException - The error comes from the hive node.public java.util.List<com.fasterxml.jackson.databind.JsonNode> query(java.lang.String collectionName,
com.fasterxml.jackson.databind.JsonNode filter,
QueryOptions options)
throws HiveException
collectionName - The name of the collection.filter - The filter to match the documents.options - The query options.HiveException - The error comes from the hive node.