Does calling JSONStore.init multiple times on the same collection have any negative side effects

懵懂的女人 提交于 2019-12-04 05:44:35

问题


I wanted to confirm the following:

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

  2. 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?

  3. 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:


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

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

  3. Yes.

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.



来源:https://stackoverflow.com/questions/23914288/does-calling-jsonstore-init-multiple-times-on-the-same-collection-have-any-negat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!