Search code examples
jsonibm-mobilefirstjsonstore

Delete function not working in JSONStore in Mobilefirst Platform


I'm trying to delete a value which is stored in JSONStore. I'm facing this error:

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

and the value is not not deleted.

Here is the code:

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("");
    }
}

I would really appreciate the help. Thanks.


Solution

  • well, this error occur because you set clear function but moiblefist(worklight) has this type of API clear so i think it is a bug . you should be use aother name which not in moiblefist API method .

    or try with latest version in http://www-01.ibm.com/support/docview.wss?uid=swg2C7000003#71