Good day everyone,. I dont understand why i got this error, “1234” can be found on my database collection but my query can’t find it. But when i try “123” it can find it on the database. I am going to trap duplicate data.
“lrn” is the fieldname (TEXT) compared to my inputValue LRN.
so i use:
.eq(“lrn”, $w(" # LRN ").value)
to find the duplicate LRN value.
export function validateLRN_click(event) {
console.log($w("#LRN").value);
validateLRN()
.then((items) => {
let vLRN = items[0].lrn;
console.log(items);
})
.catch( (err) => {
console.log(err);
});
async function validateLRN() {
let result = await wixData.query("officialEnrolled")
.limit(1000)
.eq("lrn", $w("#LRN").value)
.find();
let allItems = result.items;
while (result.hasNext()) {
result = await result.next();
allItems = allItems.concat(result.items);
}
return allItems;
}
}