Parse platform 解析服务器错误:未捕获的内部服务器错误。{&&x201C;堆栈”;:“;错误”;}
我有用户导入查询:Parse platform 解析服务器错误:未捕获的内部服务器错误。{&&x201C;堆栈”;:“;错误”;},parse-platform,Parse Platform,我有用户导入查询: const userObj = Parse.Object.extend("User"); var addingList = []; for (var i = 0; i < downloadedCustomers.length; i++) { var user = new userObj(); user.set("username", downloadedCustomers[i].cardcode); user.set
const userObj = Parse.Object.extend("User");
var addingList = [];
for (var i = 0; i < downloadedCustomers.length; i++) {
var user = new userObj();
user.set("username", downloadedCustomers[i].cardcode);
user.set("password", downloadedCustomers[i].password);
user.set('name', downloadedCustomers[i].cardname);
addingList.push(user)
user.save( { useMasterKey: true }).then((success)=>{
console.log(success)
}).catch((error)=>{
console.log(error)
})
}
有些钥匙保存了,还有一些没有保存
如何每次成功导入所有密钥
PS:user.signUp()上的情况也一样。我修复了将对象请求分成10个块的问题。 似乎解析用户对象节省了处理和解析的时间
for (h = 0, k = addingList.length; h < k; h += chunk2) {
temparray = addingList.slice(h, h + chunk2);
await Parse.Object.saveAll(temparray,{useMasterKey:true}).then((success) => {
console.log(h + chunk2 + ’ customers were added from total ’ + k);
return h + chunk2 + ’ customers were added from total ’ + k
}).catch((error) => {
console.log('Some customers were failed to import in chunk : ’ + h + ‘. Error:’ + error);
console.log(error)
return 'Some customers were failed to import in chunk : ’ + h + ‘. Error:’ + error
});
}
for(h=0,k=addingList.length;h{
log(h+chunk2+'客户是从总计'+k'中添加的);
返回h+chunk2+'客户从总计'+k'中添加
}).catch((错误)=>{
console.log('某些客户在区块中导入失败:'+h+'。错误:'+Error);
console.log(错误)
return“某些客户在区块中导入失败:'+h+'。错误:'+Error
});
}
块大小应小于20,因为它是saveAll()函数中的默认对象数组限制
for (h = 0, k = addingList.length; h < k; h += chunk2) {
temparray = addingList.slice(h, h + chunk2);
await Parse.Object.saveAll(temparray,{useMasterKey:true}).then((success) => {
console.log(h + chunk2 + ’ customers were added from total ’ + k);
return h + chunk2 + ’ customers were added from total ’ + k
}).catch((error) => {
console.log('Some customers were failed to import in chunk : ’ + h + ‘. Error:’ + error);
console.log(error)
return 'Some customers were failed to import in chunk : ’ + h + ‘. Error:’ + error
});
}