我所看到的realm的所有文档,特别是react原生的,都希望我使用托管在他们的云平台上的同步的realm。信息是“本地存储”的,但有没有办法在不使用他们的云服务的情况下进行设置呢?
发布于 2020-10-03 06:01:54
不要将“here”属性传递给配置,您可以看到所有可用的道具here
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';
...
});
你应该看看领域文档Jay linked (Realm React Getting Started Guide),这已经解释得很好了。
https://stackoverflow.com/questions/64141592
复制相似问题