I think Parse has made some changes to its objects without providing a clear memo. I built my app with Node and most of the code rests on my server instead of Cloud Code. Recently I've noticed a number of errors on code that previously tested well. At first I thought it was security settings or Parse versions (I'm currently using the latest version, 1.6.7). I reverted back and updated and nothing has helped with this issue save for transporting my code to the cloud.
I look forward to real help/suggestions, I've already looked at the docs and I'm not finding what I need so please save your breath if you were to suggest that comment. Here is some example code illustrating the problem:
var Parse = require('parse/node');
Parse.initialize("app key", "JS key", "master key");
//for this example the app key and JS key may be backward but they are
correct in the project.
var array = [{key: value}, {key1: value1}, {key2: value2}]
var Object = Parse.Object.extend("Table");
var objectQuery = new Parse.Query(Object);
objectQuery.first({
success: function(result){
var Id = result.get("user").id//this correctly provides me with the ID!
_.each(array, function(n){
_.mapObject(n, function(v, k){
var Next = Parse.Object.extend("Info");
var nextQuery = new Parse.Query(Next);
nextQuery.equalTo("name", k);
nextQuery.find({
success: function(Row){
var problem1 = _.map(Row, function(n){return _.find(n)})
console.log(problem1);//this used to show me the JSON
key value pairs if it were an object or the array or
whatever, now I just get ['Info'] from the console.log.
var problem2 = _.map(problem1, function(n){return
_.extend(n, {id: userId})});//this far ['Info']
has proven completely impenetrable. Granted I've used
underscore here but I've tried operations with basic
javascript functions like concat and any data within the
Parse Object is completely ignored. I'd like to do other
stuff from here but there is no point as I can't get
beyond 'undefined' should I try doing anything else with `the data.`
}})})})}})
I'm desperate to move on from this and I believe it is something idiosyncratic. I've scoured Stack Overflow and other sources for days now trying to figure it out. Clearly I need some hand holding and I'm desperate to move on. Thanks.