title: How to query for ids and properties stored in object
body: <p>So I'm storing checkbox data in an object that is stored with Parse.com. This is working correctly and is storing the object as follows:</p>
  
  <pre><code>Object {c1: false, c2: false, c3: false}
  </code></pre>
  
  <p>Where 'c1'=id of the checkbox and false obviously is the boolean value for unchecked. </p>
  
  <p>I'm trying to create a function that queries that object and then rewrites the checkboxes with the properties. Here is my attempt at that:</p>
  
  <pre><code>var Checklist = Parse.Object.extend("Checklist");
  
  
          //get checkboxes from parse and load them onto screen
          function getChecklist() 
          {
              var user = Parse.User.current();
              var q = new Parse.Query(Checklist);
              q.include("user");
              q.equalTo("user", user);
              q.descending("createdAt");
              q.find({
                  success: function(results)
                  {   
                          //this variable will need to change to be associated with the user's checklist
                          var i=0;
                          var check = results[i].get("check");
                          //takes object check and sorts it into order
                          var sortedKeys = Object.keys(check).sort();
                          console.log(check[Object.keys(check)[0]]);
                          //ATTEMPT AT checking the boxes correllated to the sorted keys id for each checkbox
  
                              for (var id in check) 
                              {
                                      $("#" + id).attr("checked", sortedKeys[id]);
                                      console.log(check);
                              }
  
                  },  error: function(error){
                      console.log("Query Error:"+error.message);
                  }
              });
          };
  
          getChecklist();
  </code></pre>
  
  <p>The 'check' is a column of checklist where the object is stored on Parse. As of now, I am unable to set the sortedKeys ('c1''c2''c3'etc.) to the checkboxes and furthermore cannot associate the boolean properties of those keys with the checkstate. </p>
  
  <p>Any advice? Here is a gist with the whole html+script if further information is needed/wanted. <a href="https://gist.github.com/ripplep/75627c25ade7c5e57883" rel="nofollow">https://gist.github.com/ripplep/75627c25ade7c5e57883</a></p>
  
  <p>P.S. I apologize if the code is formatted inconsistently, as I am fairly new to programming. </p>
  
  <p>EDIT with correct code:</p>
  
  <pre><code>function getChecklist() 
          {
              var user = Parse.User.current();
              var q = new Parse.Query(Checklist);
              q.include("user");
              q.equalTo("user", user);
              q.descending("createdAt");
  
              q.first({
                  success: function(checklist)
                  {   
                          //this variable will need to change to be associated with the user's checklist
  
                          var check = checklist.get("check");
                          console.log(check);
                          //takes object check and sorts it into order
  
                          //console.log(check[Object.keys(check)[0]]);
                          //ATTEMPT AT checking the boxes correllated to the sorted keys id for each checkbox
  
                              for (var id in check) 
                              {
                                      $("#" + id).attr("checked", check[id]);
                                      console.log(check);
                              }
  
                  },  error: function(error){
                      console.log("Query Error:"+error.message);
                  }
              });
          };
  </code></pre>