Parse & JS: Basic Query

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

Say we have these data in the table and we have like to find out the movie that was released in the year 2013.

The general pattern is to create a Parse.Query, put conditions on it, and then retrieve an Array of matching Parse.Objects using find.

For example, to retrieve of the title of the movie with a particular releaseYear, use the equalTo method to constrain the value for a key.


<!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>Movie not found</h1>

    <div style='display:none' class='success'>
        <h1>Movie Found</h1>

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

    var query = new Parse.Query(MovieObj);

    query.equalTo('releaseYear', 2013);

                success: function(movieObj) {
                    var title = movieObj[0].get('titleName');


Try The Code

The array name of the matching Parse.Object is movieObj and we use movieObj[0].get to retrieve the title of the movie.

Series Navigation<< Parse & JS: Destroying objects
Parse & JS: Retrieving multiple records >>