So, you can see I created a PUT REST Operation which I believe is correct but I don’t know what blocks to add to complete the service and get through the Mission.
With this task you will update an existing object in the database using the Backendless Database API. In order for the task to be recognized as complete, an object must be updated in the Person table. If you work on the tasks in the same order as listed, you already have a few working programs. Continuing to expand them is the way to go! Below is a sample JS program which retrieves the first object from the database, updates a property and saves the object back:
const APP_ID = 'XXXXXXX-7252-9A9E-FFF3';
const API_KEY = 'XXXXXXX-4591-4886-9A54';
Backendless.initApp(APP_ID, API_KEY);
Backendless.Data.of('Person').findFirst()
.then(function (object) {
// update the object - assign a random value
// to the "age" property
object.age = Math.round( Math.random() * 50 );
// now save the object back in the database
Backendless.Data.of('Person').save(object)
.then( function (savedObject) {
console.log( 'Object has been updated' );
})
.catch(function (error) {
console.log( 'Error updating object ' +
error.message);
throw error;
});
})
.catch(function (error) {
console.log( 'Error ' + error.message);
throw error;
});
After you run the program, you can verify the object has been updated in the database. This can be done by clicking the Data icon in Backendless console and selecting the Person table. Value for the age property should be different than in the original code which saved the object:
Unlike the Missions before Crud Rookie there are no instructions so I am learning as much as I can but I haven’t found anything that shows the Crud Rookie assignments exactly as they are asked.
You can find these blocks in the Data Api Section Monosnap
And Set property in block in the Object Section Monosnap
As an alternative, you can complete this mission with any other kind of SDK that is supported in Backendless. I will leave you a link to the docs where you can find the information you need to complete this mission.