Cloud function triggers for objects


Is there any way to view request.object json key values with or other logging methohds just return [object Object] for objects.


This code will print John in logger when called

const myJSON = '{"name":"John"}';
const myObj = JSON.parse(myJSON);
x =;

you can always use something like

It is not working unfortunately

Did you get any error? this return just undefined.

Also I tried a lot of version of JSON.parse method. But it is sometime returned afterSave caught an error Unexpected.

I can acces variable in json with that method,
const state = request.object.get(β€œstate”);
That is working properly.

But I need to see all json data. Any debugging method or logging method for json data can be more helpful


With'{"Name":"John", "Pet": "Dog"}')) you should see something like this.

and with

const myObj = JSON.parse('{"Name":"John", "Pet": "Dog"}');
x = myObj.Name;
y = myObj.Pet;;;

you should get something like this

can you share your afterSave function

@johnversus thank you,

I tried as below and it worked

Moralis.Cloud.afterSave("Race", async (request) => {
const obj = JSON.stringify(request.object)
const myObj = JSON.parse(obj);
x = myObj.objectId;;