Cannot use moralis services after migrating from moralis server to self-hosted parse server

I am aware of that. However, I said in my last message that I used the demo/index.html provided within this repository:

It has the auth implemented just as it should be implemented in the migration guide. I am still getting an error in that. This is what I am trying to say. All of the routes on the parse server are forbidden. Not just the auth. I have checked the appID and it is correct.

did you read about the authentication here?
https://v1docs.moralis.io/moralis-dapp/getting-started/self-hosting-moralis-server/client-connection#note-about-authentication

what is the message that you get to sign? what it is its format?

Hey. So, I reinstalled the backend and that fixed the issue. I am not sure what was going wrong there. However, other than authentication, would other methods’ implementation would also change? Like for getNFTOwners etc?

The other endpoints should work directly without changes, or at least that is my expectation

Most of the endpoints seem to be working with a few changes in arguments at a few places. However, the issue arises with using Moralis.query() function. I am not able to retrieve data from BscTransactions table from the MongoDB that is connected to my parse server. Any idea what is going wrong here? I am fairly certain that my database is connected perfectly with the parse server as new users do get inserted when performing auth. Yet I am getting a bunch of errors for this query. The error is also an empty object in response. So no idea what is going on here.

Note: I am using Moralis-v1 with nextjs.

try to see if there is more info in the server logs, it looks like a 500 error is returned somewhere

Yes, in the server logs, I am getting this error.


What may be causing this? There does exist a BscTransactions named collection

Form that error I don’t know. What is the line that generates that error? It looks like a variable is undefined

All I did was:
import Moralis from ‘moralis-v1’
const query = new Moralis.Query(“BscTransactions”);
query.containedIn(“to_address”, n);
//where n is an array of smart contract addresses
const results = await query.find();

I get an error when query.find is called. Even if I do not put the query.containedIn parameters, I still get the same error.

can you try with a different table to see if it works?

Just came across this in the documentation:

Where do I get the Parse term in react? What library is it from?

if you write a cloud function, then you have to use Parse instead of Moralis in that cloud function, then you can call that cloud function in front end.

I don’t know how or if you can use Parse sdk directly in react. Parse sdk is from Parse server.

There were no custom cloud functions in the project when I initially started the migration. There is Moralis.query was being used but now I just can’t seem to use it through the parse server. If you can send me relevant links to explore this. It might be quite helpful.

you can try to make a simple cloud function and call it to see if it works
https://v1docs.moralis.io/moralis-dapp/cloud-code/cloud-functions

and you add a query in that cloud function, by using Parse. instead of Moralis.

https://v1docs.moralis.io/moralis-dapp/getting-started/self-hosting-moralis-server/optional-features/custom-cloud-code

I was able to track down the issue’s root cause. All of the queries are working except for tables:

  • BscTransactions
  • BscTokenTransfer

The collections do not even load on the parse dashboard. What can be a solution to this?

  • If I use mongodb compass, I can easily view that there is no issue with fetching both the collections.
  • On the moralis hosted server, I can fetch data from those collections. However, this is not the case for the database that is running on my local machine.

I used mongodump and mongorestore to transfer the data

can you check the id if it is a string or something else for those tables? or if a column has a different type than the standard types?

There is one difference. Both the collections do not have this column in my parse dashboard.
image
The NumberDecimal type does not exist on my dashboard(if I try to add a column) however it does exist on Moralis dashboard.

only those 2 tables have a column of type number decimal?

what about the object id? what type of format it is?

ObjectID is string in both the server. It is just this NumberDecimal field which is not available. All other field’s data types and names both match for both the dashboards.


I just used the parse-server from here (and my guess is the this may be the updated server which solved my problem) but this has a different problem. The parse dashboard route does not seem to be working and there is no parseDashboard.ts file in the src folder of this repo. This is official repo though.
  • Still getting this after manually adding dashboard files.
    image

Initially, I was using this:

  • It has the parse dashboard yet gives the NumberDecimal types error.