Right now in backend/handler.js, bongocats is determined like so:
This variable is used to hold the total amount of videos currently in the bongocats database. This means that whenever a new entry is added to the database this constant needs to be changed and the whole backend must be redeployed. That’s obviously not ideal.
A better way to do this would be to calculate bongocats on the fly within the bongo function, using the DescribeTable API call offered by DynamoDB to get the total amount of items in the table.
Right now in backend/handler.js,
bongocatsis determined like so:This variable is used to hold the total amount of videos currently in the bongocats database. This means that whenever a new entry is added to the database this constant needs to be changed and the whole backend must be redeployed. That’s obviously not ideal.
A better way to do this would be to calculate
bongocatson the fly within thebongofunction, using the DescribeTable API call offered by DynamoDB to get the total amount of items in the table.