func (b *DynamoDBBackend) DeleteBucket(path []string, key string) error {
	fullPath := b.key(append(path, key)...)
	query := "HashKey = :hashKey AND begins_with (#K, :key)"
	attrV := map[string]string{":key": fullPath, ":hashKey": hashKey}
	attrN := map[string]*string{"#K": aws.String("Key")}
	av, err := dynamodbattribute.MarshalMap(attrV)
	input := dynamodb.QueryInput{KeyConditionExpression: aws.String(query), TableName: &b.tableName, ExpressionAttributeValues: av, ExpressionAttributeNames: attrN}
	out, err := b.svc.Query(&input)
	if err != nil {
		return trace.Wrap(err)
	}

	// TODO: manage paginated result
	for _, item := range out.Items {
		var r record
		dynamodbattribute.UnmarshalMap(item, &r)
		if strings.Compare(fullPath, r.Key[:len(fullPath)]) == 0 {
			// TODO: bulk delete to optimize
			b.deleteKey(r.Key)
		}
	}
	return nil
}
// DeleteBucket remove all prefixed keys
// WARNING: there is no bucket feature, deleting "bucket" mean a deletion one by one
DeleteBucket remove all prefixed keys
WARNING: there is no bucket feature, deleting "bucket" mean a deletion one by one
// DeleteBucket remove all prefixed keys // WARNING : there is no bucket feature deleting " bucket " mean a deletion one by one
func (b *DynamoDBBackend) DeleteBucket(path []string, key string) error {
	fullPath := b.key(append(path, key)...)
	query := "HashKey = :hashKey AND begins_with (#K, :key)"
	attrV := map[string]string{":key": fullPath, ":hashKey": hashKey}
	attrN := map[string]*string{"#K": aws.String("Key")}
	av, err := dynamodbattribute.MarshalMap(attrV)
	input := dynamodb.QueryInput{KeyConditionExpression: aws.String(query), TableName: &b.tableName, ExpressionAttributeValues: av, ExpressionAttributeNames: attrN}
	out, err := b.svc.Query(&input)
	if err != nil {
		return trace.Wrap(err)
	}
	for _, item := range out.Items {
		var r record
		dynamodbattribute.UnmarshalMap(item, &r)
		if strings.Compare(fullPath, r.Key[:len(fullPath)]) == 0 {
			b.deleteKey(r.Key)
		}
	}
	return nil
}
func ( b * DynamoDBBackend ) DeleteBucket ( path [ ] string , key string ) error { fullPath := b . key ( append ( path , key ) ... ) query := " " attrV := map [ string ] string { " " : fullPath , " " : hashKey } attrN := map [ string ] * string { " " : aws . String ( " " ) } av , err := dynamodbattribute . MarshalMap ( attrV ) input := dynamodb . QueryInput { KeyConditionExpression : aws . String ( query ) , TableName : & b . tableName , ExpressionAttributeValues : av , ExpressionAttributeNames : attrN } out , err := b . svc . Query ( & input ) if err != nil { return trace . Wrap ( err ) } for _ , item := range out . Items { var r record dynamodbattribute . UnmarshalMap ( item , & r ) if strings . Compare ( fullPath , r . Key [ : len ( fullPath ) ] ) == 0 { b . deleteKey ( r . Key ) } } return nil }
DeleteBucket remove all prefixed keys
WARNING: there is no bucket feature, deleting "bucket" mean a deletion one by one
DeleteBucket remove all prefixed keys WARNING : there is no bucket feature deleting " bucket " mean a deletion one by one
// TODO: manage paginated result // TODO: bulk delete to optimize