Hello. I am using the ReactNative SDK and my schema in code looks like this
{
name: "User",
primaryKey: "_id",
properties: {
_id: "string",
stytchOD: { type: "string", mapTo: "stytchID" },
application_id: { type: "string?", mapTo: "applicationID" },
customer_id: { type: "string?", mapTo: "customerID" },
first_name: { type: "string?", mapTo: "firstName" },
last_name: { type: "string?", mapTo: "lastName" },
dob: "string?",
address: "string?",
phone: "string?",
email: "string?",
nationality: "string",
unique_verification_number: {
type: "string?",
mapTo: "uniqueVerificationNumber",
},
verification_type: { type: "string?", mapTo: "verificationType" },
photo: "data?",
isActive: { type: "bool", default: false },
createdAt: { type: "date", default: new Date() },
groups: "string[]", //"Group{}"
},
}```
But when I console.log the user:
const user = useObject(User, user.id)
console.log(user)
It looks like this:
{
"_id": "realm-id-382903289302",
"address": null,
"application_id": null,
"createdAt": 2022-06-27T13:28:52.512Z,
"customer_id": null,
"dob": null,
"email": null,
"firstName": "miasohoa",
"first_name": null,
"groups": Array [],
"isActive": true,
"last_name": null,
"nationality": "AU",
"phone": null,
"photo": null,
"stytch_id": "random-id-37862873892",
"unique_verification_number": null,
"verification_type": null,
}
So when I update user.firstName it does not save because the user variable only has a user.first_name property that I cannot access. Am I using the mapTo property incorrectly? I am using a JS class that has instance variables that match the mappedTo names.