strange behaviour: how image property is passed by backend function

rry to bother but step by step I’m trying to sorts things out…
If console.log variable pizzaList[ 0 ].pizzaPic , get 2 different results in frontend f() vs. backend f():

I’m lost.
Same variable 2 different formats.

Correct one is the one printed on backend. but when passed back to frontend function, format changes…

sorry, know I’m starting to get boring … hope someone will be able to spend some time to give me some bright light through “corvid tunnel” :slight_smile:
THX in advance

BACKEND code:

export function pizzaMenu() {
 return wixData.query('pizzaListDB')
    .find()
    .then ((results) => {
 let pizzaList=results.items

        console.log('backend')
        console.log(pizzaList[0].pizzaPic)
 
 return pizzaList

    })  
}

console.log output:


this is the correct one to assign to $w(‘#image1’).src

FRONT END code:

$w.onReady(function () {

    pizzaMenu()
    .then((pizzaList) => {
 
        $w('#menu').rows=pizzaList
        $w('#menu').show

        console.log('frontend')
        console.log(pizzaList[0].pizzaPic)
 
 
 let pizzaImg=pizzaList[0].pizzaPic
 
        $w('#image1').src=pizzaImg
        $w('#image1').show 
    })

console.log output:

Format on frontend gives me error when try to assign to $w(‘#image1’).src

Wix code SDK error: The src parameter that is passed to the src method cannot be set to the value [object Object]. It must be of type string.

database:


interface:

solved! If I move the following code:

let pizzaImg=pizzaList[0].pizzaPic
 
        $w('#image1').src=pizzaImg
        $w('#image1').show

before (and not after as it was originally)

$w('#menu').rows=pizzaList
        $w('#menu').show

        console.log('frontend')
        console.log(pizzaList[0].pizzaPic)

it works. I don’t understand reason why. but works