I will add multi Lookup values:
var items = List.getItems(camlQuery);
clientContext.load(items);
clientContext.executeQueryAsync(
function(sender, args) {
var itemEnum = items.getEnumerator();
// if we have an item, update it
if (itemEnum.moveNext()) {
// update the item
var current = itemEnum.get_current();
//update item lookup
var lookups = [];
for (var ii in lookupsIds) {
var lookupValue = new SP.FieldLookupValue();
lookupValue.set_lookupId(lookupsIds[ii]);
lookups.push(lookupValue);
}
console.log(lookups);
current.set_item('Category', lookups);
current.update();
clientContext.load(current);
output :
(3) [SP.FieldLookupValue, SP.FieldLookupValue, SP.FieldLookupValue] 0: SP.FieldLookupValue {$1s_1: "3"} 1: SP.FieldLookupValue {$1s_1: ","} 2: SP.FieldLookupValue {$1s_1: "4"} length: 3 proto: Array(0)
my problem, the values of lookups (3,4) do not add in the list