本文整理了Java中com.mongodb.client.model.Filters.type()
方法的一些代码示例,展示了Filters.type()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Filters.type()
方法的具体详情如下:
包路径:com.mongodb.client.model.Filters
类名称:Filters
方法名:type
[英]Creates a filter that matches all documents where the value of the field is of the specified BSON type.
[中]创建与字段值为指定BSON类型的所有文档匹配的筛选器。
代码示例来源:origin: T-baby/MongoDB-Plugin
public MongoQuery type(String key, String type) {
query.add(Filters.type(key, type));
return this;
}
代码示例来源:origin: com.cybermkd/MongodbPlugin
public MongoQuery type(String key, String type) {
query.add(Filters.type(key, type));
return this;
}
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-core
@Override
public BsonFilterExpression visit(NullFilter filter, MongoResolutionContext<?> context) {
// not exists or it is not null
return resolveFieldName(filter.getLeftOperand(), context)
.map(fn -> Filters.or(Filters.not(Filters.exists(fn)), Filters.type(fn, BsonType.NULL)))
.map(bson -> BsonFilterExpression.create(bson)).orElse(null);
}
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-core
@Override
public BsonFilterExpression visit(NotNullFilter filter, MongoResolutionContext<?> context) {
// exists and it is not null
return resolveFieldName(filter.getLeftOperand(), context)
.map(fn -> Filters.and(Filters.exists(fn), Filters.not(Filters.type(fn, BsonType.NULL))))
.map(bson -> BsonFilterExpression.create(bson)).orElse(null);
}
代码示例来源:origin: com.holon-platform.mongo/holon-datastore-mongo-core
Filters.not(Filters.type(countByField, BsonType.NULL)))));
if (!query.getDefinition().isDistinct()) {
内容来源于网络,如有侵权,请联系作者删除!