Reputation: 87
I reinstalled the MacOs operating system, my working code has failed.
I don't understand, it was working before reinstalling.
My project detail is; "react": "16.9.0" "react-native": "0.61.1", "realm": "^3.6.5",
I was tried realm 3.2.0 and 3.1.0 versions but not working, the same error persists.
export function RealmDB_SetLoginUser(Data)
{
realm.write(() =>
{
let LoginUser = realm.objects('LoginUser');
realm.delete(LoginUser);
realm.create('LoginUser', {
Name: Data.Name,
Password: Data.Password,
IsTest: Data.IsTest,
});
});
}
Could you please help me?
Upvotes: 4
Views: 1596
Reputation: 54
DataMo.schema = {
name: 'DataMo',
primaryKey: 'id',
properties: {
id: 'int',
year: 'string',
}
};
const realm: Realm = new Realm({
schema: [
DataMo.schema
]
});
export default realm;
Replace schema: [DataMo] to schema: [DataMo.schema]
Upvotes: 3