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

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.

Parse dashboard doesn’t work with that decimal number. That decimal number is not supported directly by parse, it was an addition added by Moralis server.

I made a mistake and did not see it correctly. I was querying the wrong tables. Unfortunately, the issue is still not resolved through either of the parse-server repositories. The collections with the decimal128 field are not abled to be fetched via Moralis.Query function.

you could connect directly to the database and query them if all you need is to query them

do you need those columns with decimal?

Would using a cloud function be advised with mongoose to directly query the tables for now?

That should work if all you need is to query the tables

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.