Coder Social home page Coder Social logo

dynamodb-data-types's People

Contributors

bneigher avatar bryancrotaz avatar jagadeeshops avatar kayomarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dynamodb-data-types's Issues

Dash as the object key fails to increment/decrement

You can create an object like this but you can't increment it using add(). it throws "ValidationException: Invalid UpdateExpression: Syntax error; token: "-", near: "MarketplaceFacilitatorTax-Principal""

{
"srTas.MarketplaceFacilitatorTax-Principal": -7.4
}

updateExpr() and nested values

Prior to trying out updateExpr(), I have a working set of UpdateItemCommand parameters that includes:

{
  TableName: 'MyTable',
  Key: { PK: { S: 'VDR123' }, SK: { S: 'VEHTESTER165' } },
  UpdateExpression: 'ADD #data.deliveryIds :deliveryIds',
  ExpressionAttributeValues: { ':deliveryIds': { SS: [Array] } },
  ExpressionAttributeNames: { '#data': 'data' },
  ReturnValues: 'UPDATED_NEW'
}

Note the nested attribute 'deliveryIds' in the data element, and that 'data' is a dynamoDB reserved word.

I expected that updateExpr() yield similar UpdateExpression, ExpressionAttributeValues and ExpressionAttributeNames:

const updates = updateExpr()
		.add({'data.deliveryIds': [deliveryId]});
const { UpdateExpression,  ExpressionAttributeValues, ExpressionAttributeNames } = updates.expr();

However, this is the result:

UpdateExpression ADD data.deliveryIds :a
ExpressionAttributeValues { ':a': { SS: [ 'DEL#31415' ] } }
ExpressionAttributeNames undefined

Note that 'data' is not aliased and when used with the UpdateItemCommand, fails.

Am I using updateExpr() incorrectly? or does it not currently support nested with reserved words?

Thanks!

issues with new node version node/4.1.1

it looks like node/4.1.1 deprecated a lot of the util functions because they no longer work and dynamodb-data-types is using these util functions. so the data mapping are not correct anymore.
is someone working on this yet?

remove() doesn't support reserved words

when using remove('TTL') or remove('year') the update expression doesn't handle it.

UpdateExpression =============> "SET test = :a, age = :b REMOVE year"

AWS Exception
ValidationException: Invalid UpdateExpression: Attribute name is a reserved keyword; reserved keyword: year

Is this module production ready?

Thanks for nice work.
I have question that is this module safe to use in production?
As I can see you not maintaing it from last year.
Please Update.

Ignore/Skip functionality

Is it possible to add functionality for ignored fields ?

{
   id: 'abc',
   $ignoredField: 'abc'
}

So at the end only "id" key will be converted.

add typescript types?

I'm guessing more people would use this if there were typescript types either in the project or generated in @types-

remove empty arrays/strings

I understand that the dynamoDB does not allow empty strings or arrays of zero length. Perhaps this lib could remove elements that are empty/null/zero length.

The reason that I'm asking is that I'm using typescript, one of the the beauties of which is interfaces. So my interface requires an attribute even if empty. So currently I have to either not use an interface, not use this lib, or roll up my sleeves and pitch in:)

..although, there would be no way to unwrap into an object that conformed to the interface so the user would have to know that. I found the following stackoverflow discussion and I'm just using a recursive clean function to remove them for now and it's working great.

remove null attribs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.