Closed jan-gerritsen closed 7 years ago
It looks like the schema you've defined in your models is doesn't match the column type you have created in Parse. Have you verified what your model definition looks like and what the column type is set in your Parse Server?
Yes. InstantMessage Class in rails:
class InstantMessage < Parse::Object
[...]
property :read, data_type: :boolean, default: false
[...]
Schema for InstantMessage
{
"_id" : "InstantMessage",
"objectId" : "string",
"updatedAt" : "date",
"createdAt" : "date",
"channel" : "*Channel",
"message" : "string",
"read" : "boolean",
"deletedBySender" : "boolean",
"deletedByRecipient" : "boolean",
"channelId" : "string"
}
Sample instance in Mongo:
{
"_id" : "1wEQk5IUUi",
"message" : "hello",
"read" : false,
"_wperm" : [
"*"
],
"_rperm" : [
"*"
],
"_acl" : {
"*" : {
"w" : true,
"r" : true
}
},
"_created_at" : ISODate("2017-07-13T04:22:45.311Z"),
"_updated_at" : ISODate("2017-07-13T04:22:45.311Z")
}
Note that the read property is false
and not "false"
Your model definition is incorrect. Try the following:
class InstantMessage < Parse::Object
property :read, :boolean, default: false
end
Please also read this section carefully as boolean properties have special methods and features
I have Class InstantMessage with a boolean property 'read'. If I try to it it like this:
The logger shows I send this request to Parse:
{"method":"PUT","path":"/parse/classes/InstantMessage/kPceVBQF7H","body":{"read":"true"}}
But this gets logged:{"code":111,"error":"schema mismatch for InstantMessage.read; expected Boolean but got String"}}
Hope you can fix this. Thanks.