我所见过的所有有关领域的文档,尤其是有关本机响应的文档,都希望我使用托管在其云平台上的同步领域。该信息是“本地存储”的,但是有什么方法可以在不使用其云服务的情况下进行设置?
不要将“ sync”属性传递给配置,您可以在此处查看所有可用的道具
const dbRealmConfig = {
schema: [model1, model2]
}
const localRealm = await Realm.open(dbRealmConfig);
// or if you need synchronously -> new Realm(dbRealmConfig);
// do whatever you want with the realm
const [grabSomeObject] = localRealm.objects('model1').filtered(`SomeModelProp = "${someVariable}"`);
localRealm.write(() => {
someVariable.SomeModelProp = 'abc';
...
});
您应该仔细阅读Realm docs Jay链接(《Realm React入门指南》),这已经很好地解释了。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句