query database perform a calculation and output the result on a repeater element rating display help

hi guys i followed this tutorial https://support.wix.com/en/article/corvid-tutorial-adding-ratings-and-reviews-to-a-wix-stores-site

which works fine within its own dedicated page and review lightbox, however i want to also display the ratings within a repeater on a different page, so i need a piece of code to perform a calculation then output the rusult on a repeater rating display element

i have tried this code below but it doesn’t work, just to mention the repeater is connected to a dataset to pull the memberProfile info, however i need the rating display to pull from a review stats database and do a calculation on

let title = wixUsers.currentUser
$w.onReady( () =>
{ $w("#dataset1").onReady( () => {
$w("#repeater1").onItemReady( ($w, itemData, index) => {

  $w("#ratingsDisplay").rating = itemData.rating;
  $w("#ratingsDisplay").numRatings = itemData.count;

 let searchValue = $w('#ratingsDisplay').rating;
 let count = $w('#ratingsDisplay').numRatings;
 // const stats = wixData.get('review-stats', title._id);
 //if (stats) {
 //let avgRating = (Math.round(stats.rating * 10 / stats.count) / 10);
 //let ratings = $w('#ratingsDisplay');
 //ratings.rating = avgRating;
 //ratings.numRatings = stats.count;
  wixData.query('review-stats',title._id)
    .contains('rating', searchValue)
    .or(wixData.query('review-stats')
      .contains('count', count)
    )
    .find()
    .then(res => {
      $w('#repeater1').data = res.items;
    } );
 
})})})