删除功能在 Mobilefirst 平台的 JSONStore 中不起作用

Delete function not working in JSONStore in Mobilefirst Platform

我正在尝试删除存储在 JSONStore 中的值。我遇到了这个错误:

03-26 18:52:10.391: I/chromium(1890): [INFO:CONSOLE(0)] "document.clear() is deprecated. This method doesn't do anything.", source:  (0)

并且该值没有被删除。

代码如下:

function clear() {
    var collectionName = 'people';

    //Build the query object
    var query = {
        _id: 3
    };

    var options = {
        exact: true
    };

    try {

        WL.JSONStore.get(collectionName).remove(query, options)

        .then(function(res) {
            alert("Success" + res);
        })

        .fail(function(errorObject) {
            alert(errorObject.msg);
        });

    } catch (e) {
        _logError("");
    }
}

非常感谢您的帮助。谢谢

嗯,这个错误发生是因为你设置了 clear 函数,但是 moiblefist(worklight) 有这种类型的 API clear 所以我认为这是一个漏洞 。你应该使用另一个不在 moiblefist API 方法中的名称。

或尝试使用 http://www-01.ibm.com/support/docview.wss?uid=swg2C7000003#71

中的最新版本