getting codes from my db is not working. Any advice?

ReferenceError: wixdata is not defined
and
WDE0025: The Diamond collection does not exist. You cannot work with a collection using the Data API before it is created in the Editor.