> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Resource: Items # Type: WixDataFilter # Action: ne # Link: https://dev.wix.com/docs/sdk/business-solutions/data/items/wix-data-filter/ne.md ## Description: Refines a filter to match items where the value of the specified field does not equal the specified value. The `ne()` method refines this filter to only match items where the value of the specified field does not equal the specified value. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string is considered not equal to the same number stored as a number. Matching strings with `ne()` is case sensitive, so `"text"` is considered not equal to `"Text"`. If the value of `field` is an array, `ne()` matches items where none of the elements of the array match the specified value. ## Schema: ```json Method: ne(field, value) Description: Refines a filter to match items where the value of the specified field does not equal the specified value. The `ne()` method refines this filter to only match items where the value of the specified field does not equal the specified value. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string is considered not equal to the same number stored as a number. Matching strings with `ne()` is case sensitive, so `"text"` is considered not equal to `"Text"`. If the value of `field` is an array, `ne()` matches items where none of the elements of the array match the specified value. Method parameters: param name: field | type: string | description: Field whose value is compared with `value`. param name: value | type: any | description: Value to match. Return type: REFERENCE Method: and(filter) Description: Adds an `and` condition to the filter. A filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition. Use the `and()` method when performing compound queries. For example, the final filter in this set of queries returns results where status is either pending or rejected **and** age is either less than 25 or greater than 65. ```js let statusFilter = items.filter() .eq("status", "pending") .or(items.filter().eq("status", "rejected")); let ageFilter = items.filter() .lt("age", 25) .or(items.filter().gt("age", 65)); let statusAndAgeFilter = statusFilter.and(ageFilter); ``` > **Notes**: > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection. > - When chaining multiple `WixDataFilter` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25: > ```js > items.filter().eq("status", "active").gt("age", 25); > ``` Method parameters: param name: filter | type: WixDataFilter | description: `WixDataFilter` used with an `and` condition. Return type: REFERENCE Method: between(field, rangeStart, rangeEnd) Description: Refines a filter to match items where the value of the specified field is within the defined range. The `between()` method refines this filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only compares values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type). The following types can be compared: - Number: Compared numerically. - Date: Compared as JavaScript Date objects. - String: Compared lexicographically: - `"A"` and `"M"` are considered between `"A"` and `"Z"`, but `"a"`, `"m"`, `"z"` and `"Z"` are not. - `"A"`, `"M"`, `"Z"`, and `"a"` are considered between `"A"` and `"z"`, but `"z"` is not. > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last. Method parameters: param name: field | type: string | description: Field to compare with `rangeStart` and `rangeEnd`. param name: rangeStart | type: undefined | description: Starting value of the range to match. param name: rangeEnd | type: undefined | description: Ending value of the range to match. Return type: REFERENCE Method: contains(field, value) Description: Refines a filter to match items where the value of the specified field contains the specified value. The `contains()` method refines the filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`. You can use `contains()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md) is a string or a reference. When specifying a field of type reference, `contains()` matches by the GUID of the referenced item as a string. To compare by other data types, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq.md) method. Method parameters: param name: field | type: string | description: Field whose value is compared with the provided value. param name: value | type: string | description: Value to locate in the specified field. Return type: REFERENCE Method: endsWith(field, value) Description: Refines a filter to match items where the value of the specified field ends with a specified value. The `endsWith()` method refines this filter to only match items where the value of the specified field ends with the specified value. Matching with `endsWith()` is not case sensitive, so `"TEXT"` is considered to end with `"ext"`. You can only use `endsWith()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md) string or reference. When specifying a field of type reference, `endsWith()` matches by the GUID of the referenced item as a string. Method parameters: param name: field | type: string | description: Field whose value is compared with the specified value. param name: value | type: string | description: Value to look for at the end of the specified field value. Return type: REFERENCE Method: eq(field, value) Description: Refines a filter to match items where the value of the specified field equals the specified value. The `eq()` method refines this filter to only match items where the value of the specified field equals the specified `value`. Values of different [types](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md) are always considered not equal. For example, a number value stored as a string does not match the same number stored as a number. Matching strings with `eq()` is case sensitive, so `"text"` is not equal to `"Text"`. If `field` points to a collection field of type array, `eq()` includes the item as long as at least one array element matches the specified `value`. Method parameters: param name: field | type: string | description: Field whose value is compared with `value`. param name: value | type: any | description: Value to compare with. Return type: REFERENCE Method: ge(field, value) Description: Refines a filter to match items where the value of the specified field is greater than or equal to the specified value. The `ge()` method refines this filter to only match items where the value of the specified field is greater than or equal to the specified value. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string does not match the same number stored as a number. If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest. The following field types can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `"abc"` is greater than or equal to `"ABC"` (because of the greater than), but `"ABC"` is not greater than or equal to `"abc"`. - Reference: Compares by the GUID of the referenced item as a string. Method parameters: param name: field | type: string | description: Field whose value is compared with the specified value. param name: value | type: undefined | description: Value to match. Return type: REFERENCE Method: gt(field, value) Description: Refines a filter to match items where the value of the specified field is greater than the specified value. The `gt()` method refines this filter to only match items where the value of the specified field is greater than the specified value. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string does not match the same number stored as a number. If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest. The following field types can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `"text"` is greater than `"Text"`. - Reference: Compares by the GUID of the referenced item as a string. Method parameters: param name: field | type: string | description: Field whose value is compared with the specified value. param name: value | type: undefined | description: Value to match. Return type: REFERENCE Method: hasAll(field, values) Description: Refines a filter to match items where the values of the specified field contain all of the specified values. The `hasAll()` method refines this filter to only match items where the specified field contains all of the specified values. Matching strings with `hasAll()` is case sensitive, so `"text"` is not equal to `"Text"`. If the value of the specified field is an array, `hasAll()` will match if there is a match in the elements of that array for all of the specified values. You can specify a list of values to match by providing an array of String, Number, or Date types as the `value` parameters. Method parameters: param name: field | type: string | description: Field whose value is compared with `values`. param name: values | type: undefined | description: Values to match. Return type: REFERENCE Method: hasSome(field, values) Description: Refines a filter to match items where the values of the specified field contain any of the specified values. The `hasSome()` method refines this filter to only match items where the specified field contains any of the specified values. Matching strings with `hasSome()` is case sensitive, so `"text"` is not equal to `"Text"`. If the value of the specified field is an array, `hasSome()` will match if any of the elements of that array match any of the specified values. If the specified field contains multiple references, pass item GUIDs in the `value` field. In such a case, `hasSome()` will match if any of the multiple references match any of the specified GUID values. You can specify a list of values to match by providing an array of String, Number, or Date types as the `value` parameters. Method parameters: param name: field | type: string | description: Field whose value is compared with `value`. param name: values | type: undefined | description: Values to match. Return type: REFERENCE Method: isEmpty(field) Description: Refines a filter to match items whose specified field does not exist or does not have any value. The `isEmpty()` method refines this filter to only match items where the value of the specified field is `null` or `undefined` or the field does not exist. If the field contains any value at all for a given item, including the empty string or an invalid value, that item will match the filter. Method parameters: param name: field | type: string | description: Field to check for a value. Return type: REFERENCE Method: isNotEmpty(field) Description: Refines a filter to match items whose specified field has any value. The `isNotEmpty()` method refines this filter to only match items where the value of the specified field is not `null` or `undefined`. If the field contains any value at all for a given item, including the empty string or an invalid value, that item will match the filter. Method parameters: param name: field | type: string | description: Field to check for a value. Return type: REFERENCE Method: le(field, value) Description: Refines a filter to match items where the value of the specified field is less than or equal to the specified value. The `le()` method refines this filter to only match items where the value of the specified field is less than or equal to the specified value. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string does not match the same number stored as a number. If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest. The following field types can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `"ABC"` is less than or equal to `"abc"` (because of the less than), but `"abc"` is not less than or equal to `"ABC"`. - Reference: Compares by the GUID of the referenced item as a string. Method parameters: param name: field | type: string | description: Field whose value is compared with the specified value. param name: value | type: undefined | description: Value to match. Return type: REFERENCE Method: lt(field, value) Description: Refines a filter to match items where the value of the specified field is less than the specified value. The `lt()` method refines this filter to only match items where the value of the specified field is less than the specified `value`. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string does not match the same number stored as a number. If a field contains a number as a String, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest. The following field types can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `"Text"` is less than `"text"`. - Reference: Compares by the GUID of the referenced item as a String. Method parameters: param name: field | type: string | description: Field whose value is compared with `value`. param name: value | type: undefined | description: Value to match. Return type: REFERENCE Method: ne(field, value) Description: Refines a filter to match items where the value of the specified field does not equal the specified value. The `ne()` method refines this filter to only match items where the value of the specified field does not equal the specified value. The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md). For example, a number value stored as a string is considered not equal to the same number stored as a number. Matching strings with `ne()` is case sensitive, so `"text"` is considered not equal to `"Text"`. If the value of `field` is an array, `ne()` matches items where none of the elements of the array match the specified value. Method parameters: param name: field | type: string | description: Field whose value is compared with `value`. param name: value | type: any | description: Value to match. Return type: REFERENCE Method: not(filter) Description: Adds a `not` condition to the filter. The `not()` method adds a `not` condition to this filter. A filter with a `not` returns all the items that match the filter as defined up to the `not` method, but don't match the filter passed to the `not` method. If the filter only contains a `not()` method, it returns all the items that don't match the filter defined by the `not` method. Method parameters: param name: filter | type: WixDataFilter | description: Filter to add to the initial filter as a `not` condition. Return type: REFERENCE Method: or(filter) Description: Adds an `or` condition to the filter. The `or()` method adds an inclusive `or` condition to this filter. A filter with an `or` returns all the items that match the filter as defined up to the `or` method, the items that match the filter passed to the `or` method, and the items that match both. The `or()` method is designed to work with 2 or more queries or filters. If you use it on its own, it will return all the items in a collection. Method parameters: param name: filter | type: WixDataFilter | description: Filter to add to the initial filter as an `or` condition. Return type: REFERENCE Method: startsWith(field, value) Description: Refines a filter to match items where the value of the specified field starts with a specified value. The `startsWith()` method refines this filter to only match items where the value of the specified field starts with the specified value. Matching with `startsWith()` is not case sensitive, so specifying `"TEXT"` is considered to start with `"tex"`. You can only use `startsWith()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data.md) string or reference. When specifying a field of type reference, `startsWith()` matches by the GUID of the referenced item as a string. Method parameters: param name: field | type: string | description: Field whose value is compared with the specified value. param name: value | type: string | description: Value to look for at the beginning of the specified field value. Return type: REFERENCE ```