import { Context } from '../context' ; import { Updates , updateInternal } from './update_by_id' ; import { DocumentWithId } from '../base/common' ; import { getChildCollection , assemblePrimaryKeyValue } from '../base/util' ; import { CompositeCondition } from '../base/conditions' ; param ctx param collectionName param objectId param parentObjectId param updates param options param options . condition returns throws throws throws export async function updateChildById < DocumentType extends DocumentWithId > ( context , collectionName , objectId , parentObjectId , updates , options = { } ) { const collection = getChildCollection ( context , collectionName ) ; const key = { [ collection . layout . primaryKey . partitionKey ] : { S : assemblePrimaryKeyValue ( collection . parentCollectionName , parentObjectId , collection . layout . indexKeySeparator ) , } , [ collection . layout . primaryKey . sortKey ] : { S : assemblePrimaryKeyValue ( collectionName , objectId , collection . layout . indexKeySeparator ) , } , } ; return updateInternal ( context , collection , key , updates , options ) ; }