This is payload object
{
“where”: {},
“limit”: 1500,
“_method”: “GET”,
“_ApplicationId”: “2”,
“_ClientVersion”: “js1.12.0”,
“_InstallationId”: “2aa46cf5-c7d9-4f1a-9024-a52115e4c792”,
“_SessionToken”: “r:265551663efe9c8f3876116ff0a46390”
}
Your payload also seems normal.
Do you see any other errors in the server console?
No there is no other error?
How i can console if any error occurs in useMoralisQuery statement?
You can use the queryMarketItems
to access the error data.
Or in another way, you can destruct the error data like this and use useEffect
to log the error
const {error} = useMoralisQuery( "MarketItem", (query) => query.limit(1500), [] );
useEffect(() => {
console.log(error);
}, [error]);
Thank you @johnversus
Can you please convert this complete query
const queryMarketItems = useMoralisQuery(
“MarketItem”,
(query) => query.limit(1500),
[]
);
const fetchMarketItems = JSON.parse(
JSON.stringify(queryMarketItems.data, [
“updatedAt”,
“price”,
“nftContract”,
“itemId”,
“sold”,
“tokenId”,
“seller”,
“owner”,
])
)
.filter(
(item) => item.seller === walletAddress || item.owner === walletAddress
)
.sort((a, b) =>
a.updatedAt < b.updatedAt ? 1 : b.updatedAt < a.updatedAt ? -1 : 0
);
add this after your code. This should log the error
useEffect(() => {
if (queryMarketItems.error) {
console.log(queryMarketItems.error);
}
}, [queryMarketItems.error]);
I saw that error log. The data attribute of transaction object is empty while i have done many transaction with my address.
So can you please suggest that why transaction data is empty?
How did you add the data in MarketItem
class? Did you use streams?
We are not using streams. Its get updated using syncs.
what is the replacement of syncs in self hosting server?
Was there any failed stream? Can you check the stream in admin dashboard in case if there is an stream data sent?
Only real time data will be added to the database. And the name of the class will be as matching will the tag stream tag.
I have passed this in the Abi section- and my stream tag name is MarketItem so in the abi name should be match?
[
{
“anonymous”: false,
“inputs”: [
{
“indexed”: true,
“internalType”: “uint256”,
“name”: “itemId”,
“type”: “uint256”
},
{
“indexed”: true,
“internalType”: “address”,
“name”: “nftContract”,
“type”: “address”
},
{
“indexed”: true,
“internalType”: “uint256”,
“name”: “tokenId”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “address”,
“name”: “seller”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “address”,
“name”: “owner”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “price”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “bool”,
“name”: “sold”,
“type”: “bool”
}
],
“name”: “MarketItems”,
“type”: “event”
}
]
Hey @priya1,
Stream will not create a DB for you by default, once you set it up, it will appear in your streams dashboard page here https://admin.moralis.io/streams
In order to have it to make and entry to your DB, you will need to use the parseServer here
Yes i have already setup and running parse server
I need to save data into parseServer. Please help me
Yes but did you install the package yet and added streamSync
?
I have added this into parse server repo in index.ts file
import { streamsSync } from ‘@moralisweb3/parse-server’;
Do i need install this?
Followed this document - https://docs.moralis.io/docs/set-up-streams-with-parse-server
{code: 1, error: “bad key in untransform: __v”}
showing this error
Yes you need to install @moralisweb3/parse-server
package.
Can you provide more details on what caused this error?
Ok it seems it was also asked here