Self-Hosting Custom MongoDB Collections

I have an issue with my Parse Server. It is connected to MoralisDB, and it is able to query most collections. However, there are three custom collections (not included with Moralis) that it is not able to query. The collections are called ā€œoptionsā€, ā€œdropsā€, and ā€œpurchasesā€. When I try to query them, either programatically or through the dashboard, I get the following error:

error: TypeError: Cannot read properties of undefined (reading 'type') 
{"code":1,"stack":"Error: TypeError: Cannot read properties of undefined (reading 'type')
   at .../parse-server/node_modules/parse-server/lib/Controllers/DatabaseController.js:1165:21
       at processTicksAndRejections (node:internal/process/task_queues:96:5)"}

What are some good next steps for me to troubleshoot the issue? I believe it may have to do with how Parse is inferring the schema.

Did you add them in the dashboard interface in order to have a schema?

If it still doesnā€™t work you can query them by connecting directly to mongo db from a cloud function.

I added them in the dashboard, but then it crashed the dashboard when I viewed those collections specifically.

It may be something specific to the data types in those collections. For example if you have a decimal type for a column then the dashboard will not work. Also if you use an object for id instead of a sting then the queries will not work as a coveted

Itā€™s not only the dashboard that isnā€™t working. If I run code from the dashboard, I also get an error:

const myObj = Parse.Object.extend('purchases');
const query = new Parse.Query(myObj);
console.log(await query.find())
Error: [object Object] at handleError (http://localhost:1337/dashboard/bundles/dashboard.bundle.js:2:1525356) 
at async eval 
(eval at <anonymous (http://localhost:1337/dashboard/bundles/dashboard.bundle.js:2:3210826), <anonymous>:11:13)"```

It may be easier to make the query directly in mongo db from a cloud function