ITPub博客

首页 > 数据库 > > sitewhere MongoDB持久化存储原理

sitewhere MongoDB持久化存储原理

作者:u_9ff4c058a0e0 时间:2022-04-24 11:30:32 0 删除 编辑

MongoDB数据持久化存储的通用处理程序

//Common handler for creating new objects. Assures that errors are handled in a consistent way. 

public static void insert(MongoCollection<Document> collection, Document object, ErrorCode ifDuplicate);

//Common handler for updating existing objects. Assures that errors are handled in a consistent way.
public static void update(MongoCollection<Document> collection, Document query, Document object);

// Common handler for deleting objects. Assures that errors are handled in a consistent way.
public static DeleteResult delete(MongoCollection<Document> collection, Document object) ;
//Get a single entity by unique id.
public static <T> T get(String id, Class<T> api, MongoCollection<Document> collection, IMongoConverterLookup lookup);

//Search the given collection using the provided query and sort. Return the paged seaerch results.
public static <T> SearchResults<T> search(Class<T> api, MongoCollection<Document> collection, Document query,Document sort, ISearchCriteria criteria, IMongoConverterLookup lookup);

//Search the given collection using the provided query and sort.
public static <T> SearchResults<T> search(Class<T> api, MongoCollection<Document> collection, Document query, Document sort, IMongoConverterLookup lookup);

// List all items in the collection that match the qiven query.
public static <T> List<T> list(Class<T> api, MongoCollection<Document> collection, Document query, Document sort,IMongoConverterLookup lookup);

//Appends filter criteria onto exiting query based on the given date range.
public static void addDateSearchCriteria(Document query, String dateField, IDateRangeSearchCriteria criteria);

//Common handler for MongoDB client exceptions.
public static SiteWhereException handleClientException(MongoClientException e);


来源 https://blog.csdn.net/orchidofocean/article/details/79835451?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165076954316782388078446%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165076954316782388078446&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-25-79835451.nonecase&utm_term=SiteWhere&spm=1018.2226.3001.4450

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69999831/viewspace-3142973/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2022-02-11

  • 博文量
    1828
  • 访问量
    20575