I try to init JSONStore Sync with Adapter in Worklight 5.0.6 like below:
var usersSearchFields = {"age":"integer","name.demo":"string"},
usersAdapterOptions = {
name: 'user',
replace: 'updateUser',
remove: 'deleteUser',
add: 'addUser',
load: {
procedure: 'getUsers',
params: [],
key: 'users'
},
accept: function (data) {
return (data.status === 200);
}
};
var collections = {
users : {
searchFields : usersSearchFields,
adapter : usersAdapterOptions
}
};
var options = {
username: 'carlos',
password: '123'
};
var usersCollection=WL.JSONStore.init(collections, options)
.then(function (res) {
logMessage('Collection has been initialized');
})
.fail(function (errobject) {
WL.Logger.debug(errobject.toString());
});
It runs successfully in the first time but after i exit app then return, it gets error: *"PROVISION_TABLE_SEARCH_FIELDS_MISMATCH"*
Anyone can help me please? Thank you very much.