Which of the following JavaScript functions can the application developer use to change the status of an order in the local JSONStore?

An application developer is using JSONStore in a mobile application to store purchase orders. The application allows sellers to modify the status of an order.
The JSONStore collection for the orders is defined in a global variable as follows: var ordCollection = { orders: { searchFields: {ord_number: ‘integer’, status: ‘string’ }
}
};
Which of the following JavaScript functions can the application developer use to change the status of an order in the local JSONStore?
A. var updateOrder = function(orderDoc, newStatus){ orderDoc.json.status = newStatus;
WL.JSONStore.update(ordCollection, orderDoc)
.then(function (numberOfDocumentsUpdated) {
// Handle success. })fail(function (errorObject) {
// Handle failure. }); };
B. var updateOrder = function(orderDoc, newStatus){ orderDoc.json.status = newStatus; var ordColInstance = WL.JSONStore.get(ordCollection); var numberOfDocumentsUpdated = ordColInsnance.update(orderDoc); if( numberOfDocumentsUpdated >= 0 ){
// Handle Success
} else {
// Handle Failure
}
};
C. var updateOrder = function(orderDoc, newStatus){ orderDoc.json.status = newStatus;
WL.JSONStore.get(‘orders’).replace(orderDoc)
.then(function (numberOfDocumentsReplaced) {
// Handle success. })fail(function (errorObject) {
// Handle failure. }); };
D. var updateOrder = function(orderDoc, newStatus){ orderDoc.json.status = newStatus; var ordColInstance = WL.JSONStore.get(‘orders’); var numberOfDocumentsReplaced = ordColInsnance.replace(orderDoc); if( numberOfDocumentsReplaced >= 0 ){
// Handle Success
} else {
// Handle Failure
}
};

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.