Thanks I took a look and tried to test this out in the JS Console with no luck - see below. Iām not sure what I am missing, but I thought this was possible per the docs at https://docs.moralis.io/moralis-server/database/objects
const customUser = Parse.User.extend('CustomUser', {
test: function(msg) { console.log("Hello " + msg); }
});
Parse.Object.registerSubclass("_User", customUser)
const uQuery = new Parse.Query(Parse.User);
const user = await uQuery.get("spEtYRcYSh2cCFqnnsOTBGRB",{useMasterKey: true});
console.log(user.className)
try {
console.log(user.test("Bob"));
}
catch (e) {
console.log("Error=" + e.message)
}
const ucQuery = new Parse.Query(customUser);
//ucQuery.equalTo("objectId", "spEtYRcYSh2cCFqnnsOTBGRB")
//const users = await ucQuery.find({useMasterKey: true});
const cUser = await ucQuery.get("spEtYRcYSh2cCFqnnsOTBGRB", {useMasterKey: true});
//console.log(customUsers)
//const customUser = users[0]
console.log(cUser.className);
try {
console.log(cUser.test("Custom"));
}
catch (e) {
console.log("Error=" + e.message)
}
leads to:
"Log":{1 item
"result":string"_User"
}
"Log":{1 item
"result":string"Error=user.test is not a function"
}
"Log":{1 item
"result":string"_User"
}
"Log":{1 item
"result":string"Error=cUser.test is not a function"
}