@@ -154,9 +154,8 @@ async function writeUpdatedExpectedPackages(
154154 _id : doc . _id ,
155155 ingestSources : {
156156 // This is pretty messy, but we need to make sure that we don't add the same source twice
157- // nocommit - does this work?
158157 $not : {
159- elemMatch : matchSource ,
158+ $ elemMatch : matchSource ,
160159 } ,
161160 } ,
162161 } ,
@@ -208,7 +207,6 @@ export async function updateExpectedPackagesForBucketAdLibPiece(
208207 await writeUpdatedExpectedPackages ( context , adlib . bucketId , documentsToSave , {
209208 fromPieceType : ExpectedPackageDBType . BUCKET_ADLIB ,
210209 pieceId : adlib . _id ,
211- // nocommit - does this work?
212210 } )
213211}
214212
@@ -221,7 +219,6 @@ export async function updateExpectedPackagesForBucketAdLibAction(
221219 await writeUpdatedExpectedPackages ( context , action . bucketId , documentsToSave , {
222220 fromPieceType : ExpectedPackageDBType . BUCKET_ADLIB_ACTION ,
223221 pieceId : action . _id ,
224- // nocommit - does this work?
225222 } )
226223}
227224
@@ -236,14 +233,7 @@ export async function cleanUpExpectedPackagesForBucketAdLibs(
236233 {
237234 studioId : context . studioId ,
238235 bucketId : bucketId ,
239- ingestSources : {
240- $elemMatch : {
241- fromPieceType : {
242- $in : [ ExpectedPackageDBType . BUCKET_ADLIB , ExpectedPackageDBType . BUCKET_ADLIB_ACTION ] ,
243- } ,
244- pieceId : { $in : adLibIds } ,
245- } ,
246- } ,
236+ // Note: this could have the ingestSources match, but that feels excessive as the $pull performs the same check
247237 } ,
248238 {
249239 $pull : {
@@ -252,7 +242,7 @@ export async function cleanUpExpectedPackagesForBucketAdLibs(
252242 $in : [ ExpectedPackageDBType . BUCKET_ADLIB , ExpectedPackageDBType . BUCKET_ADLIB_ACTION ] ,
253243 } ,
254244 pieceId : { $in : adLibIds } ,
255- } as any , // nocommit - can we avoid this? Does this query even work?
245+ } as any , // This cast isn't nice, but is needed for some reason
256246 } ,
257247 }
258248 )
0 commit comments