---
title: "CollectionRuleRelation"
description: "描述指定的列如何与条件相关"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-relation'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-relation.md'
---
# CollectionRuleRelation

描述指定的列如何与条件相关

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Enum

## Type Signature

`CollectionRuleRelation`

## Values

* `NOT_EQUALS`

  属性的值与条件不相等

* `STARTS_WITH`

  条件出现在属性的开头

* `CONTAINS`

  条件包含在属性范围内

* `ENDS_WITH`

  属性以条件结束

* `EQUALS`

  属性的值等于条件

* `GREATER_THAN`

  属性的值大于条件

* `LESS_THAN`

  属性的值小于条件

* `NOT_CONTAINS`

  条件不包含在属性范围内

## Schema Definition

```graphql
enum CollectionRuleRelation { 
	NOT_EQUALS 
	STARTS_WITH 
	CONTAINS 
	ENDS_WITH 
	EQUALS 
	GREATER_THAN 
	LESS_THAN 
	NOT_CONTAINS  
}
```

## Field from

* [CollectionRuleConditions](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions.md).allowedRelations

  允许的规则关系

* [CollectionRuleConditions](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule-conditions.md).defaultRelation

  此规则最常用的关系

* [CollectionRule](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/objects/collection-rule.md).relation

  规则所基于的运算符的类型。例如：`equals`, `contains`, 或 `not_equals`

## Input field from

* [CollectionRuleInput](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-input.md).relation

  规则所基于的运算符的类型。例如：`equals`, `contains`, 或 `not_equals`

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

