Question:
[Clearly ask your question.]
Product:
Using Wix Editor, Velo, Wixdata
My query accepts search criteria and runs perfectly connecting to a Repeater.
I assume I have a syntax problem with the totalCount statement. Watched multiple videos and read docs but can’t get this to work.
matchCount = results.totalCount
The code includes arbitrarily setting variable matchCount to 123, then using that variable in the above totalCount statement (expecting a value of 4 ) but it remains 123 as if the statement never ran.
Any suggestions are appreciated. Thanks, Mike
Below is the code
let matchCount = 123 ;
wixData.query(“Archives”)
.ge(“title”, searchFrom)
.and(wixData.query(“Archives”).le(“title”, searchTo))
.find()
.then(results => {
$w(‘#repeater1’).data = results.items
// let resultCount = results.totalCount
matchCount = results.totalCount
}) // ================= “then” statement END
// Check results
console.log ( "count is - " + matchCount)