实际上,我想在打开Realm之前应用检查,是否有任何方法可以检查Realm数据库中是否存在提供的路径 如果存在,还希望检查模式是否已经存在
考虑拥有名称为myrealm.realm的领域
var realm = Realm.open({ path:'myrealm.realm', schema:[ { name: 'Dog',
properties: {name : 'string'}} , { name: 'Person', properties: { name :
'string'}} ]}).then( (realmInstance) => {
realmInstance.objects('Customer').isValid() // this must return false as
customer is not present but it shows exception
})
请提出验证模式的方法