How to access database?

The idea: If the button is clicked i want to find the row fitting the input from a dropdown menu and increase this items “number” by 1.

What I basically wanna do is, let the user vote for an item from a dropdown menu and increase its vote count.

Unfortunatly i didnt find a way to get an items index found by a query so its all a bit improvised and now im lost. Also please ignore all the seemingly unefficient way of variable declarations…i tried to narrow down the error:

import wixData from ‘wix-data’ ;
import {local} from ‘wix-storage’ ;

$w.onReady( function () {
local.setItem( “id” , 0 )
});

export function button50_click(event) {
let vote = $w( ’ #dropdown1 ’ ).value

wixData.query( ‘Leservorschlage2’ )
.eq( ‘title’ ,vote)
.find()
.then(res => {
let item = $w( " #dataset5 " )
var ID = item.number //number is coloumn in database
local.setItem( “id” ,ID )
//console.log(“item.number=”,ID)
var id2 = local.getItem( “id” )
var id3 = id2.valueOf()
$w( " #dataset5 " ).setCurrentItemIndex(id3);
//console.log(“currentitem index =”,$w(" #dataset5 ").getCurrentItemIndex())
let item2 = $w( " #dataset5 " )
let val = item2.done + 1 ;
$w( " #dataset5 " ).setFieldValue( “done” , val);
$w( " #dataset5 " ).save();
})
. catch ((error) => {
console.log(error);
}); }

Any idea why its not working? Apparently the number assigned to local variable “id” fails to be used as the Id for setCurrentItemIndex: console.log:
item.number= undefined currentitem index = 0

and even if I directly assign a value to “ID”, the console.log output for “currentitem index” remains 0.

Thanks a lot for your help.