Assigning query result to a variable

All you need is…

import wixData from 'wix-data';

//----------USER-INTERFACE---------------------------
let DATABASE = "CARS"; //<--- your DATABASE-ID here!!!
//----------USER-INTERFACE---------------------------

$w.onReady(async()=>{
    let myOpelCars = await getData("OPEL"); 
    let myBMWcars = await getData("BMW");
    let myVWcars = await getData("VW");

    console.log("OPEL-CARS: ", myOpelCars);
    console.log("BMW-CARS: ", myBMWcars);
    console.log("VW-CARS: ", myVWcars);
});

async function getData(model) {
    return wixData.query(DATABASE)
    .eq("model", model)
    .find()
    .then((res)=>{
        let items = res.items;
        return items
    })      
}

Modify the code and insert your own DB-ID (orange marked code-line).
Test it and see what you get inside of your → CONSOLE.

Example “CARS”-DATABASE…