Schema Error and not updating - "code":111,"error":"schema mismatch for Profile.dob; expected String but got Date"}

I tried a few approaches with this, but i do know that dealing with the Schema on any occasion is a bit finicky for want of a better word, Ive updated it to reflect the dob is a date but still hit this error

    const schema = new Parse.Schema('Profile')
    schema.addField('dob', 'Date', { required: false});
    schema.addDate('dob', { required: false});
    await schema.update();

You can create the class manually using parse-dashboard UI and it wlll set the necessary type itself.

I had to restart the server after the change and it seemed to do the job, i guess maybe a manual restart is required to kick parse back with the new schema

The server knows about the updated schema through hooks. If hooks are disabled then the server needs to restart to recognize the updated schema. We removed schema pulling some time ago, but we are planning to add it back, see Re-add schema pulling · Issue #8229 · parse-community/parse-server · GitHub.

1 Like