我正在使用Parse Cloud Code在Parse数据库中创建一些对象。当我创建一个对象时,我首先添加一些预设值,然后想要存储数组的所有唯一元素:
if (bizStrategy != null) {
person.add("biz", bizStrategy);
}
if (legal != null) {
person.add("biz", legal);
}
if (financialConsulting != null) {
person.add("biz", financialConsulting);
}
if (gettingStarted != null) {
person.add("biz", gettingStarted);
}
if (hr != null) {
person.add("biz", hr);
}
if (businessDev != null) {
person.add("biz", businessDev);
}
if (careerAdvice != null) {
person.add("biz", careerAdvice);
}
if (internationalDev != null) {
person.add("biz", internationalDev);
}
if (otherBiz != null) {
var bizArray = separateTags(otherBiz);
for(var i=0, len=bizArray.length; i < len; i++){
var skill = bizArray[i];
person.addUnique("biz", skill);
}
}
但是,我收到以下错误: “无法将AddUnique Op与之前的Op合并
我希望你能帮忙!
编辑:记录
E2015-11-17T16:18:00.808Z]v246 Ran job standardisePeople with:
Input: {}
Result: Error: Cannot merge AddUnique Op with the previous Op
at t.a.value (Parse.js:14:21539)
at n.value (Parse.js:14:6067)
at n.value (Parse.js:14:6551)
at main.js:331:20
at e.<anonymous> (Parse.js:15:1692)
at e.s (Parse.js:14:27156)
at Parse.js:14:27542
at i (Parse.js:14:27497)
at e.n.value (Parse.js:14:27527)
at Parse.js:15:1669