可以在Cloud Code之外操作Parse对象吗?

时间:2015-12-15 08:46:54

标签: javascript node.js parse-platform

我认为Parse对其对象进行了一些更改,但没有提供明确的备忘录。我用Node构建了我的应用程序,大部分代码都放在我的服务器而不是Cloud Code上。最近我注意到之前测试良好的代码有很多错误。起初我以为是安全设置或Parse版本(我目前使用的是最新版本1.6.7)。我还原并更新,除了将我的代码传输到云之外没有任何帮助解决这个问题。

我期待真正的帮助/建议,我已经查看了文档,而且我没有找到我需要的内容,所以如果您建议发表评论,请节省您的呼吸。以下是一些说明问题的示例代码:

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.`

 }})})})}})

我不顾一切地继续前进,我相信这是一种特殊的东西。我现在已经搜索了Stack Overflow和其他来源几天试图解决这个问题。很明显,我需要一些手握,我不顾一切地继续前进。感谢。

0 个答案:

没有答案