This topic describes fields and operators that are supported in simple queries, aggregation operations, and geographic queries.
Description
Simple queries support the following operators: eq (equal to), gt (greater than), gte (greater than or equal to), lt (less than), lte (less than or equal to), nested (nested query), exist (existence query), match-phrase (match-phrase query), and prefix (prefix query). Aggregation operations support the following operators: min (minimum), max (maximum), average (the average operator, which is similar to the AVG function in SQL), sum (summation), count (counting), distinct (the distinct operator, which counts the number of distinct values in a row and is similar to the DISTINCT keyword in SQL), and group (group counting, which may produce a result with an error if the number of groups is large. The distinct operator returns an approximate value: a value that is close to the accurate value if the number of rows to which the operator is applied is less than 10,000 or a value that has an error of approximately 2% if the number of rows to which the operator is applied is greater than or equal to 100 million.
Geographic queries support the LatLong field, on which the following operators can be used:
geo-distance: searches within the specified distance (radius) of a center point. The operands of the operator uses the "latitude,longitude;radiusInMeters" format. For example, "33,119;1000" specifies that the query is performed within a radius of 1,000 meters from the "33,119" center point.
geo-bounding-box: searches within a rectangle defined by latitudes and longitudes of the top-left and bottom-right vertexes. The operands uses the "topLeftLatitude,topLeftLongitude;bottomRightLatitude,bottomRightLongitude" format. For example, "35,118.5;33.5,120" specifies that the query is performed within the rectangle that is defined by the top-left vertex (35,118.5) and the bottom-right vertex (33.5,120).
geo-polygon: searches within a polygon that is defined by the latitudes and longitudes of at least three points in the "latitude,longitude;latitude,longitude;latitude,longitude;..." format. For example, "33,118;33,120;35,120;35,118" specifies that the query is performed within the polygon defined by the following points: 33,118, 33,120, 35,120, and 35,118.
If the Customlabels field is used to query objects, the query is performed based on the key-value tags of the objects. The keys and values of object tags are not case-sensitive.
For example, to query objects that have the
Bucket=examplebucket
tag, specify the{"Bucket": "examplebucket"}
condition.When you use the OSSTagging.* field to query objects, replace the asterisk (*) with the key of the object tag. The system queries the object based on the key-value pair of the object tag. The keys and values of object tags are case-sensitive.
For example, to query objects that have the
owner=John
tag, specify the{"Field": "OSSTagging.owner", "Value": "John", "Operation": "eq"}
condition.When you use the OSSUserMeta.* field to query objects, replace the asterisk (*) with the key of the user metadata. The system queries objects based on the key and value of the user metadata header. The key of the user metadata is not case-sensitive, whereas the value is case-sensitive.
For example, if you want to query objects that have the
x-oss-meta-location=hangzhou
user metadata, specify the{"Field": "OSSUserMeta.x-oss-meta-location", "Value": "hangzhou", "Operation": "eq"}
condition.
Supported fields and operators
The following table describes the fields and operators that are supported in simple queries and aggregation operations.
Fields marked with a number sign superscript (#) are reserved and currently unavailable.
Simple query
Field | Operator | Sorting | ||||
eq, gt, gte, lt, and lte | match-phrase | prefix | nested | exist | ||
AccessControlAllowOrigin | Supported | Not supported | Supported | Not supported | Not supported | Supported |
AccessControlRequestMethod | Supported | Not supported | Supported | Not supported | Not supported | Supported |
Addresses.AddressLine | Not supported | Supported | Not supported | Supported | Supported | Not supported |
Addresses.City | Supported | Not supported | Supported | Supported | Supported | Not supported |
Addresses.Country | Supported | Not supported | Supported | Supported | Supported | Not supported |
Addresses.District | Supported | Not supported | Supported | Supported | Supported | Not supported |
Addresses.Language | Supported | Not supported | Supported | Supported | Supported | Not supported |
Addresses.Province | Supported | Not supported | Supported | Supported | Supported | Not supported |
Addresses.Township | Supported | Not supported | Supported | Supported | Supported | Not supported |
Album | Supported | Not supported | Supported | Not supported | Not supported | Supported |
AlbumArtist | Supported | Not supported | Supported | Not supported | Not supported | Supported |
Artist# | Supported | Not supported | Supported | Not supported | Not supported | Supported |
AudioStreams.CodecName | Supported | Not supported | Supported | Supported | Supported | Not supported |
AudioStreams.Language | Supported | Not supported | Supported | Supported | Supported | Not supported |
AudioStreams.Lyric | Not supported | Supported | Not supported | Supported | Supported | Not supported |
Bitrate | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
Bodies.Confidence | Supported | Not supported | Not supported | Supported | Supported | Not supported |
CacheControl | Supported | Not supported | Supported | Not supported | Not supported | Supported |
Composer# | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ContentDisposition | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ContentEncoding | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ContentLanguage | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ContentType | Supported | Not supported | Supported | Not supported | Not supported | Supported |
CreateTime | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
CroppingSuggestions.AspectRatio | Supported | Not supported | Supported | Supported | Supported | Not supported |
CroppingSuggestions.Confidence | Supported | Not supported | Not supported | Supported | Supported | Not supported |
CustomId | Supported | Not supported | Supported | Not supported | Not supported | Supported |
CustomLabels.* | Supported | Not supported | Supported | Not supported | Supported | Not supported |
DocumentContent | Not supported | Supported | Not supported | Not supported | Not supported | Not supported |
DocumentText | Supported | Supported | Not supported | Not supported | Supported | Supported |
Duration | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
ETag | Supported | Not supported | Supported | Not supported | Not supported | Supported |
Figures.Age | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Figures.AgeSD | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Figures.Emotion | Supported | Not supported | Supported | Supported | Supported | Not supported |
Figures.EmotionConfidence | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Figures.FaceQuality | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Figures.FigureClusterId | Supported | Not supported | Supported | Supported | Supported | Not supported |
Figures.FigureConfidence | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Figures.FigureId | Supported | Not supported | Supported | Supported | Supported | Not supported |
Figures.FigureType | Supported | Not supported | Supported | Supported | Supported | Not supported |
Figures.Gender | Supported | Not supported | Supported | Supported | Supported | Not supported |
Figures.GenderConfidence | Supported | Not supported | Not supported | Supported | Supported | Not supported |
FileAccessTime | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
FileHash | Supported | Not supported | Supported | Not supported | Not supported | Supported |
FileModifiedTime | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
Filename | Supported | Supported | Supported | Not supported | Not supported | Supported |
ImageHeight | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
ImageWidth | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
Labels.CentricScore | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Labels.LabelConfidence | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Labels.LabelLevel | Supported | Not supported | Not supported | Supported | Supported | Not supported |
Labels.LabelName | Supported | Not supported | Supported | Supported | Supported | Not supported |
Labels.Language | Supported | Not supported | Supported | Supported | Supported | Not supported |
Labels.ParentLabelName | Supported | Not supported | Supported | Supported | Supported | Not supported |
LatLong | Supported | Not supported | Not supported | Not supported | Not supported | Not supported |
MediaType | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ObjectACL | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ObjectId | Supported | Not supported | Supported | Not supported | Not supported | Supported |
OCRContents.Contents | Not supported | Supported | Not supported | Supported | Supported | Not supported |
OCRContents.Language | Supported | Not supported | Supported | Supported | Supported | Not supported |
OSSCRC64 | Supported | Not supported | Supported | Not supported | Not supported | Supported |
OSSDeleteMarker | Supported | Not supported | Supported | Not supported | Not supported | Supported |
OSSExpiration | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
OSSObjectType | Supported | Not supported | Supported | Not supported | Not supported | Supported |
OSSStorageClass | Supported | Not supported | Supported | Not supported | Not supported | Supported |
OSSTagging.* | Supported | Not supported | Supported | Not supported | Supported | Not supported |
OSSTaggingCount | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
OSSURI | Supported | Not supported | Supported | Not supported | Not supported | Supported |
OSSUserMeta.* | Supported | Not supported | Supported | Not supported | Supported | Not supported |
OSSVersionId | Supported | Not supported | Supported | Not supported | Not supported | Supported |
PageCount | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
Performer | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ProduceTime | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
ServerSideDataEncryption | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ServerSideEncryption | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ServerSideEncryptionCustomerAlgorithm | Supported | Not supported | Supported | Not supported | Not supported | Supported |
ServerSideEncryptionKeyId | Supported | Not supported | Supported | Not supported | Not supported | Supported |
Size | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
Subtitles.CodecName | Supported | Not supported | Supported | Supported | Supported | Not supported |
Subtitles.Content | Not supported | Supported | Not supported | Supported | Supported | Not supported |
Subtitles.Language | Supported | Not supported | Supported | Supported | Supported | Not supported |
Title | Supported | Supported | Supported | Not supported | Not supported | Supported |
UpdateTime | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
URI | Supported | Not supported | Supported | Not supported | Not supported | Supported |
VideoHeight | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
VideoScore | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
VideoStreams.CodecName | Supported | Not supported | Supported | Supported | Supported | Not supported |
VideoStreams.Language | Supported | Not supported | Supported | Supported | Supported | Not supported |
VideoWidth | Supported | Not supported | Not supported | Not supported | Not supported | Supported |
Aggregation
Field | Operator | Sorting | |
min, max, average, and sum | count, distinct, and group | ||
AccessControlAllowOrigin | Not supported | Supported | Supported |
AccessControlRequestMethod | Not supported | Supported | Supported |
AdaptiveProduceTime | Not supported | Supported | Supported |
Addresses.AddressLine | Not supported | Not supported | Not supported |
Addresses.City | Not supported | Not supported | Not supported |
Addresses.Country | Not supported | Not supported | Not supported |
Addresses.District | Not supported | Not supported | Not supported |
Addresses.Language | Not supported | Not supported | Not supported |
Addresses.Province | Not supported | Not supported | Not supported |
Addresses.Township | Not supported | Not supported | Not supported |
Album | Not supported | Supported | Supported |
AlbumArtist | Not supported | Supported | Supported |
Artist# | Not supported | Supported | Supported |
AudioStreams.CodecName | Not supported | Not supported | Not supported |
AudioStreams.Language | Not supported | Not supported | Not supported |
AudioStreams.Lyric | Not supported | Not supported | Not supported |
Bitrate | Supported | Supported | Supported |
Bodies.Confidence | Not supported | Not supported | Not supported |
CacheControl | Not supported | Supported | Supported |
Composer# | Not supported | Supported | Supported |
ContentDisposition | Not supported | Supported | Supported |
ContentEncoding | Not supported | Supported | Supported |
ContentLanguage | Not supported | Supported | Supported |
ContentType | Not supported | Supported | Supported |
CreateTime | Not supported | Supported | Supported |
CroppingSuggestions.AspectRatio | Not supported | Not supported | Not supported |
CroppingSuggestions.Confidence | Not supported | Not supported | Not supported |
CustomId | Not supported | Supported | Supported |
CustomLabels.* | Not supported | Not supported | Not supported |
DocumentContent | Not supported | Supported | Not supported |
Duration | Supported | Supported | Supported |
ETag | Not supported | Supported | Supported |
Figures.Age | Not supported | Not supported | Not supported |
Figures.AgeSD | Not supported | Not supported | Not supported |
Figures.Emotion | Not supported | Not supported | Not supported |
Figures.EmotionConfidence | Not supported | Not supported | Not supported |
Figures.FaceQuality | Not supported | Not supported | Not supported |
Figures.FigureClusterId | Not supported | Not supported | Not supported |
Figures.FigureConfidence | Not supported | Not supported | Not supported |
Figures.FigureId | Not supported | Not supported | Not supported |
Figures.FigureType | Not supported | Not supported | Not supported |
Figures.Gender | Not supported | Not supported | Not supported |
Figures.GenderConfidence | Not supported | Not supported | Not supported |
FileAccessTime | Not supported | Supported | Supported |
FileHash | Not supported | Supported | Supported |
FileModifiedTime | Not supported | Supported | Supported |
Filename | Not supported | Supported | Supported |
ImageHeight | Supported | Supported | Supported |
ImageWidth | Supported | Supported | Supported |
Labels.CentricScore | Not supported | Not supported | Not supported |
Labels.LabelConfidence | Not supported | Not supported | Not supported |
Labels.LabelLevel | Not supported | Not supported | Not supported |
Labels.LabelName | Not supported | Not supported | Not supported |
Labels.Language | Not supported | Not supported | Not supported |
Labels.ParentLabelName | Not supported | Not supported | Not supported |
Language | Not supported | Supported | Supported |
LatLong | Not supported | Supported (count and distinct) | Not supported |
MediaType | Not supported | Supported | Supported |
ObjectACL | Not supported | Supported | Supported |
ObjectId | Not supported | Supported | Supported |
OCRContents.Contents | Not supported | Not supported | Not supported |
OCRContents.Language | Not supported | Not supported | Not supported |
OSSCRC64 | Not supported | Supported | Supported |
OSSDeleteMarker | Not supported | Supported | Supported |
OSSExpiration | Not supported | Supported | Supported |
OSSObjectType | Not supported | Supported | Supported |
OSSStorageClass | Not supported | Supported | Supported |
OSSTagging.* | Not supported | Not supported | Not supported |
OSSTaggingCount | Supported | Supported | Supported |
OSSURI | Not supported | Supported | Supported |
OSSUserMeta.* | Not supported | Not supported | Not supported |
OSSVersionId | Not supported | Supported | Supported |
PageCount | Supported | Supported | Supported |
Performer | Not supported | Supported | Supported |
ProduceTime | Not supported | Supported | Supported |
ServerSideDataEncryption | Not supported | Supported | Supported |
ServerSideEncryption | Not supported | Supported | Supported |
ServerSideEncryptionCustomerAlgorithm | Not supported | Supported | Supported |
ServerSideEncryptionKeyId | Not supported | Supported | Supported |
Size | Supported | Supported | Supported |
Subtitles.CodecName | Not supported | Not supported | Not supported |
Subtitles.Content | Not supported | Not supported | Not supported |
Subtitles.Language | Not supported | Not supported | Not supported |
Title | Not supported | Supported | Supported |
UpdateTime | Not supported | Supported | Supported |
URI | Not supported | Supported | Supported |
VideoHeight | Supported | Supported | Supported |
VideoScore | Supported | Supported | Supported |
VideoStreams.CodecName | Not supported | Not supported | Not supported |
VideoStreams.Language | Not supported | Not supported | Not supported |
VideoWidth | Supported | Supported | Supported |