Hi,
It's been a month I'm looking for an answer on Wix but not find yet.
How can I retrieve the database item in the backend file of Wix (.jsw) I just want to take the items from the database in the backend.
If anyone knows or is it possible to do it.
Because I'm able to query my database item in backend but I'm not able to retrieve the items so I can use in my frontend or anywhere I want like with API's
So in the JSW file write something like:
import wixdata from 'wix-data'; export function getItem(id){ wixData.get("CollectionName", id) .then(r => return r); }
and in the front end:
import {getItem} from 'backend/myFileName.jsw'; let toGet = "dasfads-dasfdsf-adsfsdaf";//use the item Id getItem(toGet) .then(r => { //do whatever you want });