Search code examples
ibm-mobilefirstjsonstore

IBM JSONStore API return's "INVALID_SEARCH_FIELD' when used with OFFSET options


We are using JSONStore API below in our Project and this was returning perfect values untill we have updated to the new IBM MFP plugin

cordova-plugin-mfp-jsonstore 8.0.2017082110

var options = {limit : 24 , offset : 24   };
WL.JSONStore.get(STORENAME).findAll(options).then(function(res){console.log(res)}).fail(function(err){console.log(err)});

The above code starts returning errors now after the update as follow

> ErrorObject {src: "find", err: 22, msg: "INVALID_SEARCH_FIELD", col:
> "STORENAME", usr: "jsonstore", …}col: "Assets"doc: {}err: 22msg:
> "INVALID_SEARCH_FIELD"res: {}src: "find"usr: "jsonstore"__proto__:
> Object

This after a long struggle found out its because of the "OFFSET" which we are using in options, if that gets removed it returns perfect values.

This i have tested only in ANDROID Devices.


Solution

  • This issue is appeared in android environment and will be fixed in the upcoming release of cordova-plugin-mfp-jsonstore release.

    For time being you can use the following fix which will resolve the issue : https://ibm.box.com/s/ws4zwy0jqlh84ag1wf7yshrdsxgig4ll

    Steps to apply test fix :

    • Replace ibmmobilefirstplatformfoundationjsonstore.jar in your application project.
    • Rebuild and run the application.