Parse & JS: Queries on String

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

Use startsWith to restrict to string values that start with a particular string.

Similar to MySQL LIKE operator, this is indexed so it is efficient for large dataset.

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


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

    var query = new Parse.Query(MoviObject);

    query.startsWith('titleName', 'Scent');

                success: function (moviObject) {
                    document.write('<h2>Movie Found:</h2>');
                    var title = moviObject[0].get('titleName');
Try The Code


Series Navigation<< Parse & JS: Return only one object

Leave a comment

Leave a Reply