[SOLVED] Incomplete event details in Mongodb on ganache server

Cross checked all my events and their abi.
The number of rows is correct but the data stored in the rows doesnt have the fields. For example, Here is the event and its ABI.

SessionCreated(bytes32,address,uint256,uint256,uint256)
{
  "anonymous": false,
  "inputs": [
    {
      "indexed": true,
      "internalType": "bytes32",
      "name": "_sessionId",
      "type": "bytes32"
    },
    {
      "indexed": true,
      "internalType": "address",
      "name": "_createdBy",
      "type": "address"
    },
    {
      "indexed": false,
      "internalType": "uint256",
      "name": "_startTime",
      "type": "uint256"
    },
    {
      "indexed": false,
      "internalType": "uint256",
      "name": "_endTime",
      "type": "uint256"
    },
    {
      "indexed": false,
      "internalType": "uint256",
      "name": "_minimumBid",
      "type": "uint256"
    }
  ],
  "name": "SessionCreated",
  "type": "event"
}

And the data in Mongodb doesnt have any of the fields, Just radom files like createdAt, objectId, confirmed etc etc.

it doesn’t work with fields that start with _, you should modify the ABI to remove that _ and then save the event sync again

Ohhhk… Let me redeploy the contracts and try again.

no, you don’t have to redeploy the contracts, only to change in the ABI that you paste in event sync

It worked… Thanks a lot.

One more thing, I am working with python on the backend to fetch event data, Is there any way in which i can connect to moralis mongodb instance or rest api’s are the only way to interact with moralis mongo instance.

This isnt working.

I used “MongoDb IP:” in Server details and initiated a connection. Every collection is giving me 0 documents.

connection["parse"]["_QuestionAnswered"].estimated_document_count()
0

also tried,

connection["classes"]["_QuestionAnswered"].estimated_document_count()
0

user table in particular has that _ at the beginning, but QuestionAnswered table should not have it

Yes it worked.
One last help.
I have created this gist to make automated entries to the EventSync table to save time.


Its isnt working.