Query a collection to see if record exists

I’m really not sharp with corvid and I feel like I must just be missing something small but very significant. I want users to type in their instagram to see if they’re eligible for a giveaway. The collection is called “Eligible” and it is made up of one column which is a list of usernames.

It keeps returning 0 as the count when I know I’m trying a username that exists in the collection.

Here’s what I got for code:

import wixData from ‘wix-data’;
$w.onReady( function () {
//TODO: write your page related code here…

});

export function button2_click(event) {
$w(“#EligibleButton”).label = “…”

let txtUsername = $w(‘#txtUsername’).value

wixData.query(“Eligible”)
.eq(“title”, “txtUsername”)
.count()
.then( (results) => {

let resultLength = results;

if (resultLength > 0) {
$w(“#EligibleButton”).label = “Yes”;
}
if (resultLength <= 0) {
$w(“#EligibleButton”).label = “No”;
}

} ) ; 

}

Thanks!
John

Check the Wix Data Query API reference for it as you are on the right path towards getting your code right.
https://www.wix.com/corvid/reference/wix-data.html#query