Skip to content

createReadStream() behavior replication in v3 #5167

Discussion options

You must be logged in to vote

Hi @jirimoravcik, to accomplish this with v3 you would need to add a middleware to the client as follow:

import {DynamoDBClient} from "@aws-sdk/client-dynamodb";
import {DynamoDBDocumentClient} from "@aws-sdk/lib-dynamodb";

const client = new DynamoDBClient({region: "us-east-2"});
client.middlewareStack.addRelativeTo(
    (next) => async (args) => {
        const { response } = await next(args);
        const readableStream = response.body; // HERE IS YOUR READABLE STREAM
        
        return {
            response,
        };
    },
    {
        name: "customResponseBodyMiddleware",
        toMiddleware: "deserializerMiddleware",
        relation: "after",
        step: "deserialize",

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RanVaknin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
2 participants