eq( )


Refines a query or filter to match items whose specified property value equals the specified value.

The eq() function refines a WixDataQuery or WixDataFilter to only match items where the value of the specified property equals the specified value.

It only matches values of the same type. For example, a number value stored as a String type does not match the same number stored as a Number type.

Matching strings with eq() is case sensitive, so "text" is not equal to "Text".

If propertyName 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 Declaration
Copy
function eq(propertyName: string, value: any): WixDataQuery;
Method Parameters
propertyNamestringRequired

The property whose value will be compared with value.


valueanyRequired

The value to match against.

Returns
Return Type:WixDataQuery
JavaScript
let newQuery = query.eq("status", "active");
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?