Console logging the table from moralis database

@cryptokid hey sir, how are you doing…
I am having trouble in console logging the table from moralis database i am using useMoralisQuery hook by it is giving me the empty array object infact my hardhat node is running and moralis server is also connected but still i cant able to print the table please help me out with this…
Here is the code snippet:


And this is I am getting in the console log:
Capture
This is the table I want to print:

Getting the table in the response but not in console:

You could log that in a useEffect that has listedNfts as it’s dependencies

useEffect(() => {
  console.log(listedNfts);
}, [listedNfts]);

yeah I tried it but it is also not working see:


It is giving me the same output

Hope you’re connected to the proper server ?

yes I am, getting the ActiveItem table in the network response but can’t able to print in console. See:

Which version of react-moralis and Moralis are you using? Can you share your serverUrl?

Capture
Moralis Server URL: https://78wkfbsitu6p.usemoralis.com:2053/server

Can you try querying another class/table to test if data/listedNfts updates, and without the query constraints (limit, descending).

Also in that last screenshot, the objectId doesn’t match any of the objects in the ActiveItem one - was this from another test?

Yeah i tried it but getting the same response and I Know object id is not correct because i restarted the server and mint an nft again that’s why the object id is different from the database just to show that i am getting response from database but can’t be able to print it on console so you can ignore that object id

const { data, error } = useMoralisQuery(

"ActiveItem",

(query) => query.limit(10).descending("tokenId")

)

useEffect(() => {

console.log("error", error)

}, [data])
When I am console logging the error I am getting this error:
Capture

Can you try installing [email protected]? And is your Moralis server updated (restarting it from your admin page will do it)?

Hi,

I am facing the exact same issue. Did you manage to resolve this?

You are not getting any data from useMoralisQuery? Another user had this issue recently, updating their Moralis dependencies fixed it.

@sofea Which version of moralis / react-moralis are you using?

Yeah did it by Moralis.Query for fetching data from the database and for this you have to import Moralis from moralis-v1

I mentioned it above moralis (1.8.1) and react-moralis(1.4.0)