Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
@webiny/db-dynamodb
Advanced tools
Readme
A set of frequently used data-dynamodb higher order functions.
For more information, please visit the official docs.
yarn add @webiny/db-dynamodb
We have a number helper functions that ease the use of either dynamodb-toolbox, filtering, sorting or just creating proper response.
Read a batch of records from the DynamoDB table.
This function accepts table and items, an array of objects created by Entity.getBatch().
Internally it reads records until there are no more to read and returns a list of read records.
Write a batch of records to the DynamoDB table.
This function accepts table and items, an array of objects created by Entity.putBatch(). It also accepts a number which defines a number of items to be written in one request. DO NOT put that number over the official DynamoDB maximum.
Internally it loops through the items received (in chunks of maxChunks
parameter) and does not return anything.
Clean up records received from the DynamoDB table.
This function accepts entity and item to be cleaned up, in case of the cleanupItem.
In case of cleanupItems
it accepts an array of items to clean up.
We use this to remove the properties that dynamodb-toolbox puts on the record automatically.
Get a single record from the DynamoDB table with given keys.
This function accepts entity and keys to fetch the record by.
It returns either record or null. By default, entity.get() returns a object with some meta data and Item
property, which contains the record (or null if no record).
Query the DynamoDB table for record(s) by given partition key and query options.
This function accepts entity to perform the query on, partitionKey
to query by and options to define the query parameters with.
The queryAll
method accepts limit
, a number with which you can load only a certain amount of records. The queryOne
method does not have that property.
Filter the DynamoDB records by given where condition.
This function accepts items (records) to be filtered, a definition of fields to filter by (not required by default if no field modification is required), where conditions (eg. {published: true, date_gte: "2021-01-01"}
) and filtering plugins.
Sort the DynamoDB records by given sort condition.
This function accepts items (records) to be sorted, sort options (eg. createdBy_ASC, id_DESC, etc.) and a definitions of fields to sort by (not required by default if no field modification is required).
FAQs
A DynamoDB driver for the @webiny/db database client.
The npm package @webiny/db-dynamodb receives a total of 520 weekly downloads. As such, @webiny/db-dynamodb popularity was classified as not popular.
We found that @webiny/db-dynamodb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.