com.mongodb.client.model.Filters.all()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中com.mongodb.client.model.Filters.all()方法的一些代码示例,展示了Filters.all()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Filters.all()方法的具体详情如下:
包路径:com.mongodb.client.model.Filters
类名称:Filters
方法名:all

Filters.all介绍

[英]Creates a filter that matches all documents where the value of a field is an array that contains all the specified values.
[中]创建一个筛选器,该筛选器匹配字段值为包含所有指定值的数组的所有文档。

代码示例

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * Creates a filter that matches all documents where the value of a field is an array that contains all the specified values.
 *
 * @param fieldName the field name
 * @param values    the list of values
 * @param <TItem>   the value type
 * @return the filter
 * @mongodb.driver.manual reference/operator/query/all $all
 */
public static <TItem> Bson all(final String fieldName, final TItem... values) {
  return all(fieldName, asList(values));
}

代码示例来源:origin: org.mongodb/mongodb-driver-core

/**
 * Creates a filter that matches all documents where the value of a field is an array that contains all the specified values.
 *
 * @param fieldName the field name
 * @param values    the list of values
 * @param <TItem>   the value type
 * @return the filter
 * @mongodb.driver.manual reference/operator/query/all $all
 */
public static <TItem> Bson all(final String fieldName, final TItem... values) {
  return all(fieldName, asList(values));
}

代码示例来源:origin: org.opencb.commons/commons-datastore-mongodb

break;
case ALL:
  filter = Filters.all(mongoDbField, queryValues);
  break;
default:

相关文章