在同一个集合上多次调用JSONStore.init会产生任何负面影响 [英] Does calling JSONStore.init multiple times on the same collection have any negative side effects

查看:114
本文介绍了在同一个集合上多次调用JSONStore.init会产生任何负面影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确认以下内容:


  1. 在我对集合调用WL.JSONStore.init方法之前,必须我首先调用removeCollection方法?

  1. Before I call the WL.JSONStore.init method on a collection, must I first call the removeCollection method?

我是否可以在同一个集合上调用WL.JSONstore.init方法,而不会产生副作用,例如设备中的重复集合原生数据库?

Can I call the WL.JSONstore.init method on the same collection without getting side effects such as duplicate collections in the device's native DB?

WL.JSONStore.init方法可以被认为是一个单例方法,基本上让现有的集合/设备的本机数据库准备接受新的记录已经存在的集合的更新?

Can the WL.JSONStore.init method be thought of as a singleton method basically letting the existing collection/device's native db be ready to accept new record updates for that already existing collection?


推荐答案


  1. 如果要删除集合的内容:init(collection1) - > removeCollection(collection1) - > init(collection1)。

  1. If you want to remove the contents of a collection: init(collection1) -> removeCollection(collection1) -> init(collection1).

正确的。你可以这样做:init(collection1) - > init(collection1) - > init(collection1) - > ......没有任何负面的副作用。

Correct. You can do: init(collection1) -> init(collection1) -> init(collection1) -> ... without any negative side-effects.

是的。

注意:一个常见问题是搜索字段不是动态的,您必须先调用removeCollection API如果你想使用新的搜索字段或其他搜索字段进行初始化。

Note: One common issue is that the search fields are not dynamic, you must call the removeCollection API first if you want to init with new search fields or additional search fields.

这篇关于在同一个集合上多次调用JSONStore.init会产生任何负面影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆