Parse & JS: Retrieving refreshed object

This entry is part 12 of 25 in the series Parse & Javascript

If you need to refresh an object you already have with the latest data that is in the Parse Cloud, you can call the fetch method.

Say the updatedAt is constantly changing in the Parse cloud.

<!doctype html>
    <title>My Parse App</title>
    <script type='text/javascript' src=''></script>
    <script type='text/javascript' src=''></script>


    <div style='display:none' class='error'>
        <h1>The object was not refreshed successfully.</h1>

    <div style='display:none' class='success'>
        <h1>The object was refreshed successfully.</h1>

    Parse.initialize('5d3sro43zBGj8AMYqWND5bFYMzAan7f5P5euZm7M', 'hlRZZqAylA7Fmah4Kk6ma8WK7QCT4cHrxjafnnkI');
    var MovieObject = Parse.Object.extend('MovieObject');
    var movieObject = new MovieObject();

    var query = new Parse.Query(MovieObject);

        success: function (movieObject) {
            // The object was refreshed successfully.
            query.get('KpM9EZvArG', {
                success: function (movieObject) {
                error: function (movieObject, error) {
        error: function (movieObject, error) {
            // The object was not refreshed successfully.
            // error is a Parse.Error with an error code and description.


Try The Code
Series Navigation<< Parse & JS: Retrieving the 3 special values using objectid
Parse & JS: Destroying objects >>

Leave a comment

Leave a Reply