title: Parse.User not returning a value on iOS for AngularJS + Cordova
body: <p>I am developing an app using <a href="http://ionicframework.com" rel="nofollow">Ionic</a> which is built using Cordova and AngularJS.</p>
  
  <p>I have been using Parse.com for the backend of the app. The app has been functioning fine on the emulator and on Android.</p>
  
  <p>However after loading the app on an iPhone (tried it on a 4S, 5, 5S and 6), the User Query returns an empty array.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>var userquery = new Parse.Query(Parse.User);
  userquery.startsWith("username", $scope.search.queryvalue);
  userquery.notEqualTo("username", $rootScope.sessionUser.get("username"));
  userquery.limit(20);
  userquery.find({
    success: function(result) {
      $scope.people = result;
    },
    error: function(error) {
      console.log("error");
    }
  });
  </code></pre>
  
  <p>As mentioned before, this code returns the right result when using the iOS Emulator and when testing the app on an Android Device. However on an iPhone is does not work.</p>
  
  <p>Anyone faced such an issue?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>After doing some more testing with some console logs I found another error. The problem is that the variable that is taken in through an input text box adds some strange REGEX parameters.</p>
  
  <p><code>console.log(userquery);</code></p>
  
  <p>This is what the output looks like </p>
  
  <pre><code>{"where":{"username":{"$regex":"^\\QTanuj\\E","$ne":"test"},"id":{"$ne":"46JOEKKKF1"}},"limit":20}
  </code></pre>
  
  <p>Again, this is only happening on an iPhone. Anyone know why <code>{"$regex":"^\\Q</code> and <code>\\E"</code> is being added around the search query value <code>Tanuj</code>?</p>
  
  <p>Could this be an AngularJS issue? Is there a way to force AngularJS to not put the variable through regex?</p>
  
  <p><strong>Further UPDATE:</strong></p>
  
  <p>Here are the console logs from the emulator:</p>
  
  <pre><code>{"where":{"username":{"$regex":"^\\Qtanuj\\E","$ne":"test"},"id":{"$ne":"46JOEKKKF1"}},"limit":20}
  </code></pre>
  
  <p>This is boggling my mind. The values work even with the $regex bit while on the emulator. But as soon as it goes on the phone, the result is blank.</p>
  
  <p>This is the console logs of the result on the iPhone: <code>result: []</code></p>
  
  <p>But on the emulator, it returns the expected values.</p>
  
  <p>What could the problem be?</p>