printing database information

Hello,

I want to print out a column from my dataset in order to see how the wix code handles that data (to see if it can be handled as a JSON).

I’ve written:
import wixData from ‘wix-data’;
import wixWindow from ‘wix-window’;

$w.onReady(function () {
//TODO: write your page related code here…

wixData.get("ifc_data", "b41afddf-1508-42d9-80bb-a2850a6d7553") 

.then( (results) => {
let item = results; //see item below
} )
.catch( (err) => {
let errorMsg = err;
} );

window.print();

My questions are:

  1. If I have a collection in which i’m trying to access a certain column, is get() the correct function? How can I get the info from a specific column?

  2. How do I use window.print() in this case in order to verify my script like a regular IDE…?

Thanks

Hi,

  1. In order to get data from a database you can use query, check out the api here .
  2. You can print the data to your console using “console.log()” and insert the data you want to print in the parentheses.
    Any way when you get data from a database it is return as a JSON.

window.print() is not possible in Wix

Found this to help me with the console.log() function.

Thanks