From 488a3af4ffd9cac870a33a1ae358cf90fd957117 Mon Sep 17 00:00:00 2001 From: James Hu <51237606+jameshu111@users.noreply.github.com> Date: Sat, 6 May 2023 16:01:38 -0400 Subject: clean up and comment remFromList --- src/fields/List.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fields') diff --git a/src/fields/List.ts b/src/fields/List.ts index eb735dec2..325b36597 100644 --- a/src/fields/List.ts +++ b/src/fields/List.ts @@ -82,11 +82,11 @@ const listHandlers: any = { hintArray.push({val : list.__fields[i], index : i}); } const res = list.__fields.splice(start, deleteCount, ...items); - // console.log(hintArray); - // console.log(list.__fields); + // the hint object sends the starting index of the slice and the number + // of elements to delete. this[Update]( items.length === 0 && deleteCount - ? { op: '$remFromSet', items: removed, hint : { start : start, deleteCount : deleteCount, hintArray : hintArray}, length: list.__fields.length } + ? { op: '$remFromSet', items: removed, hint : { start : start, deleteCount : deleteCount }, length: list.__fields.length } : items.length && !deleteCount && start === list.__fields.length ? { op: '$addToSet', items, length: list.__fields.length } : undefined -- cgit v1.2.3-70-g09d2