Monday, 5 June 2017

Add non existing element to array using dynamoose

I have a table in AWS DynamoDB, Using dynamoose for querying from NodeJS, An item structure is like,

{
    name: 'x',
    gmail: 'x@gmail.com',
    mob: '987654321',
    Friends: [ {name:'a'}, {name:'b'} ]
}

I need to update the array 'Friends' such that when adding a new array of friends like below

[ {name:'a'}, {name:'b'},{name:'c'}]

it should add non existent element only!



via Sabreena

No comments:

Post a Comment