类 DatabaseController
- java.lang.Object
-
- org.elastos.hive.vault.database.DatabaseController
-
public class DatabaseController extends java.lang.ObjectThe wrapper class is to access the database module of the hive node.
-
-
构造器概要
构造器 构造器 说明 DatabaseController(NodeRPCConnection connection)Create by the RPC connection.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 longcountDocuments(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, CountOptions options)Count the documents by filter.voidcreateCollection(java.lang.String collectionName)Create the collection.voiddeleteCollection(java.lang.String collectionName)Delete the collection by name.intdeleteMany(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, DeleteOptions options)Delete all matched document by the filter.intdeleteOne(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.JsonNodefindOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, FindOptions options)Find the first matched document by filter.java.util.List<Collection>getCollections()Get user's collections.InsertResultinsertMany(java.lang.String collectionName, java.util.List<com.fasterxml.jackson.databind.JsonNode> documents, InsertOptions options)Insert many documents.InsertResultinsertOne(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.UpdateResultupdateMany(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.UpdateResultupdateOne(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.
-
-
-
构造器详细资料
-
DatabaseController
public DatabaseController(NodeRPCConnection connection)
Create by the RPC connection.- 参数:
connection- The RPC connection.
-
-
方法详细资料
-
createCollection
public void createCollection(java.lang.String collectionName) throws HiveExceptionCreate the collection.- 参数:
collectionName- The name of the collection.- 抛出:
HiveException- The error comes from the hive node.
-
deleteCollection
public void deleteCollection(java.lang.String collectionName) throws HiveExceptionDelete the collection by name.- 参数:
collectionName- The name of the collection.- 抛出:
HiveException- The error comes from the hive node.
-
getCollections
public java.util.List<Collection> getCollections() throws HiveException
Get user's collections.- 返回:
- Collection list.
- 抛出:
HiveException- The error comes from the hive node.
-
insertOne
public InsertResult insertOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode document, InsertOptions options) throws HiveException
Insert one document.- 参数:
collectionName- The name of the collection.document- The document.options- Insert options.- 返回:
- The details of the insert operation.
- 抛出:
HiveException- The error comes from the hive node.
-
insertMany
public InsertResult insertMany(java.lang.String collectionName, java.util.List<com.fasterxml.jackson.databind.JsonNode> documents, InsertOptions options) throws HiveException
Insert many documents.- 参数:
collectionName- The name of the collection.documents- The document.options- Insert options.- 返回:
- The details of the insert operation.
- 抛出:
HiveException- The error comes from the hive node.
-
updateOne
public UpdateResult updateOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options) throws HiveException
Update the first matched document by the filter.- 参数:
collectionName- The name of the collection.filter- The filter to filter the matched document.update- The update data.options- The update options.- 返回:
- The details of the update operation.
- 抛出:
HiveException- The error comes from the hive node.
-
updateMany
public UpdateResult updateMany(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, com.fasterxml.jackson.databind.JsonNode update, UpdateOptions options) throws HiveException
Update all matched documents by the filter.- 参数:
collectionName- The name of the collection.filter- The filter to filter the matched document.update- The update data.options- The update options.- 返回:
- The details of the update operation.
- 抛出:
HiveException- The error comes from the hive node.
-
deleteOne
public int deleteOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, DeleteOptions options) throws HiveExceptionDelete the first matched document by the filter.- 参数:
collectionName- The name of the collection.filter- The filter to filter the matched document.options- The delete options.- 返回:
- The details of the delete operation.
- 抛出:
HiveException- The error comes from the hive node.
-
deleteMany
public int deleteMany(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, DeleteOptions options) throws HiveExceptionDelete all matched document by the filter.- 参数:
collectionName- The name of the collection.filter- The filter to filter the matched documents.options- The delete options.- 返回:
- The details of the delete operation.
- 抛出:
HiveException- The error comes from the hive node.
-
countDocuments
public long countDocuments(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, CountOptions options) throws HiveExceptionCount the documents by filter.- 参数:
collectionName- The name of the collection.filter- The filter to match the documents.options- Count options.- 返回:
- The number of the matched documents.
- 抛出:
HiveException- The error comes from the hive node.
-
findOne
public com.fasterxml.jackson.databind.JsonNode findOne(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, FindOptions options) throws HiveExceptionFind the first matched document by filter.- 参数:
collectionName- The name of the collection.filter- The filter to match the document.options- The find options.- 返回:
- The first matched document for the find operation.
- 抛出:
HiveException- The error comes from the hive node.
-
find
public java.util.List<com.fasterxml.jackson.databind.JsonNode> find(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, FindOptions options) throws HiveExceptionFind all matched document by filter.- 参数:
collectionName- The name of the collection.filter- The filter to match the documents.options- The find options.- 返回:
- All matched documents for the find operation.
- 抛出:
HiveException- The error comes from the hive node.
-
query
public java.util.List<com.fasterxml.jackson.databind.JsonNode> query(java.lang.String collectionName, com.fasterxml.jackson.databind.JsonNode filter, QueryOptions options) throws HiveExceptionQuery the documents by filter and options.- 参数:
collectionName- The name of the collection.filter- The filter to match the documents.options- The query options.- 返回:
- All matched documents for the query operation.
- 抛出:
HiveException- The error comes from the hive node.
-
-