WixData eq works like contains

Hey,

I am using some conditions to filter data with user input and shows result to the user. I want to get data exact same with user input. If user tpye one letter wrong get no data.

Here’s my code

export function search() {
 let startQuery = wixData.query("Destinations").eq("start", local.getItem("startDest"));
 let endQuery =  wixData.query("Destinations").eq("end", local.getItem("endDest"));

 let finalQuery = startQuery.and(endQuery).ascending("price");
    finalQuery
        .find().then(res => {
 if(res.items.length>0)
                $w('#repeater1').data = res.items;
 else
                console.log("no match");
        })
        .catch((error) => {
            console.log("Error while getting data " + error.message);
        });
}

But when I type ‘a’ query return all data contains ‘a’. Also when I type text start with lowercase it returns data but the data in dataset starts with uppercase so it works like contains. Why this is happening?

If you are using the equals function and simply put in the letter ‘a’, then it will find everything in your dataset or dataset field that equals the letter a.

Also, the equals function should be case sensitive, so if you have word in the search, then it should only find word and not Word. Check that the text in the live version of your dataset are all starting with uppercase and not all lowercase.

https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#eq

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

Description
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 the value of the propertyName property is an Array, eq() includes items in which any of the elements of the Array match the specified value.