[SOLVED] Is it posible to create a MongoDB database using Moralis API?

Hey guys, I am trying to create a database that is automatically updated depending on whether the user has or no longer has NFTs from a specific contract using MongoDB, just like this function does:

https://docs.moralis.io/reference/getnftowners

Is this possible in anyway using Moralis? Is it possible, for example, to use this function to make a database automatically upgradeable in terms of users who has or no longer has NFTs from a specific contract?

No this is not possible with the Moralis API. You can update your MongoDB database with your own code, here’s an example with a Node.js app/script.

Thank you so much for your help, but I found another solution for my problem, but got into some error that I don’t know what is happening here:

This is the code(got from the link I sent on the first post):

export async function getServerSideProps(context) {
    const address = 'xxxxx';
    
    await Moralis.start({
        apiKey: process.env.MORALIS_API_KEY,
    });

    const response = await Moralis.EvmApi.nft.getNFTOwners({
        address,
        chain: 5,
    });
    console.log(response.result);  
}

But I am getting this error message:

Try updating the moralis sdk to latest version.

I think Moralis.EvmApi.nft.getNFTOwners is not available in the older version

Thank you so much, I did it and it worked, I was just wondering if you could tell me how can I display the “ownerOf:” address, since when I ask for logging this information it is shown as “ownerOf: [EvmAddress],”.

That is normal when you log the data in server using response.result. If you send this data to client as json, you can view the data properly.

To view json data in server you can use response.toJSON() instead of response.result