Class: Query

BaaS~Query()

查询

Constructor

new Query()

Source:

Methods

(static) and(…querys) → {Query}

and 操作符。将多个 Query 对象使用 and 操作符进行合并
Parameters:
Name Type Attributes Description
querys Array.<Query> <repeatable>
Query 对象
Source:
Returns:
- 新的 Query 对象
Type
Query

(static) or(…querys) → {Query}

or 操作符。将多个 Query 对象使用 or 操作符进行合并
Parameters:
Name Type Attributes Description
querys Array.<Query> <repeatable>
Query 对象
Source:
Returns:
- 新的 Query 对象
Type
Query

arrayContains(key, arr) → {this}

数组包含判断。 判断逻辑:Record[key] 是数组类型,且包含 arr 数组中的元素
Parameters:
Name Type Description
key string 用于查询判断的字段
arr Array.<any> 用于判断的数组
Source:
Returns:
Query 实例
Type
this

compare(key, operator, value) → {this}

比较判断,将 Record[key] 与 value 使用 operator 进行判断,筛选出 符合条件的 Record。
Parameters:
Name Type Description
key string 用于查询判断的字段
operator string 判断操作符
value string 用于判断的值
Source:
Returns:
Query 实例
Type
this

contains(key, str) → {this}

包含判断,筛选出符合条件(Record[key] 包含了字符串 str)的 Record。
Parameters:
Name Type Description
key string 用于查询判断的字段
str string 用于判断的字符串
Source:
Returns:
Query 实例
Type
this

exists(key) → {this}

字段存在判断。 判断逻辑:Record[key] 不是 undefined
Parameters:
Name Type Description
key string 用于查询判断的字段
Source:
Returns:
Query 实例
Type
this

hasKey(key, fieldName) → {this}

Object 类型字段的属性存在判断。 判断逻辑:Record[key] 为 Object 类型,且 Record[key][fieldName] 不为 undefined
Parameters:
Name Type Description
key string 用于查询判断的字段
fieldName string 字段名称
Source:
Returns:
Query 实例
Type
this

in(key, arr) → {this}

包含判断,筛选出符合条件(数组 arr 包含 Record[key])的 Record。
Parameters:
Name Type Description
key string 用于查询判断的字段
arr Array.<any> 用于判断的数组
Source:
Returns:
Query 实例
Type
this

include(key, point) → {this}

多边形包含判断,在指定多边形集合中找出包含某一点的多边形(geojson 类型)。 判断逻辑:Record[key] 包含 point
Parameters:
Name Type Description
key string 用于查询判断的字段
point GeoPoint
Source:
Returns:
Query 实例
Type
this

isNotNull(key) → {this}

字段不为 Null 判断。 判断逻辑:Record[key] 不是 null
Parameters:
Name Type Description
key string 用于查询判断的字段
Source:
Returns:
Query 实例
Type
this

isNull(key) → {this}

字段为 Null 判断。 判断逻辑:Record[key] 是 null
Parameters:
Name Type Description
key string 用于查询判断的字段
Source:
Returns:
Query 实例
Type
this

matches(key, regExp) → {this}

正则判断,筛选出符合条件(正则表达式 regExp 能匹配 Record[key])的 Record。
Parameters:
Name Type Description
key string 用于查询判断的字段
regExp RegExp 正则表达式
Source:
Returns:
Query 实例
Type
this

notExists(key) → {this}

字段不存在判断。 判断逻辑:Record[key] 是 undefined
Parameters:
Name Type Description
key string 用于查询判断的字段
Source:
Returns:
Query 实例
Type
this

notIn(key, arr) → {this}

不包含判断,筛选出符合条件(数组 arr 不包含 Record[key])的 Record。
Parameters:
Name Type Description
key string 用于查询判断的字段
arr Array.<any> 用于判断的数组
Source:
Returns:
Query 实例
Type
this

within(key, polygon) → {this}

多边形包含判断,在指定点集合中,查找包含于指定的多边形区域的点(geojson 类型)。 判断逻辑:polygon 包含 Record[key]
Parameters:
Name Type Description
key string 用于查询判断的字段
polygon GeoPolygon 多边形
Source:
Returns:
Query 实例
Type
this

withinCircle(key, point, radius) → {this}

圆包含判断,在指定点集合中,查找包含在指定圆心和指定半径所构成的圆形区域中的点(geojson 类型)。 判断逻辑:以 point 为圆心、以 redius 为半径的圆包含 Record[key]
Parameters:
Name Type Description
key string 用于查询判断的字段
point GeoPoint 圆心
radius number 半径
Source:
Returns:
Query 实例
Type
this

withinRegion(key, point, maxDistance, minDistanceopt) → {this}

圆环包含判断,在指定点集合中,查找包含在以某点为起点的最大和最小距离所构成的圆环区域中的点(geojson 类型)。 判断逻辑:以 point 为圆心、以 minDistance 最小半径、以 maxDistance 为最大半径的圆环包含 Record[key]
Parameters:
Name Type Attributes Default Description
key string 用于查询判断的字段
point GeoPoint 圆心
maxDistance number 最大半径
minDistance number <optional>
0 最小半径
Source:
Returns:
Query 实例
Type
this