Closed teebu closed 8 years ago
Hi,
I've updated library to support inserting string sets and number sets like
{
number: 1,
object: {a: 1, b: 'string'},
string_set: DynamoDB.stringSet(['xxx','yyy','zzz']),
number_set: DynamoDB.numberSet([5,4,3,2,1])
}
documentation not updated yet
I'll be back with a solution for "add() to stringSet/numberSet" also (addSS maybe)
-adrian
Another feature request, remove/delete item from string set.
Teebu,
I've published 0.1.48 with support for add/remove from stringSet and numberSet
{
a_number: 1,
b_number: DynamoDB.add(5), // increment by 5
a_string_set: DynamoDB.stringSet(['xxx','yyy','zzz']),
b_string_set: DynamoDB.add(['aaa','bbb'],'SS'), // add to stringSet
c_string_set: DynamoDB.del(['xxx','yyy'],'SS'), // remove from stringSet
a_number_set: DynamoDB.numberSet([5,4,3,2,1]),
b_number_set: DynamoDB.add([11,22],'NS'), // add to numberSet
c_number_set: DynamoDB.del([3,2],'NS'), // remove from numberSet
}
Observation:
stringset_test: DynamoDB.add('a', 'SS'), // add to stringSet
doing this, doesn't add 'a' to a stringset, it removes that field entirely.
The add() metod will support all data types Including L but now it only supports:
.add( 5 ) for N .add( [ ... ], type ) for SS and NS
If we support .add( 'a', 'SS') then we also need to Support .add('a', 'b', 'SS' )
I'm thinking that another way of solving this without using a second parameter wiuld be:
.add( DynamoDB.stringSet([...]))
Right now, since nothing related to adding to stringset is published into the documentation, add(param) assumes its adding to a number and will remain The same for backword compatibility
numberSet / stringSet support is now available and documented.
Please let me know if anything missing
thanks,
I think right now, this module only supports arrays, but I'd like to add unique values only, I think using a String Set is the way that is done.
Can you consider adding that feature.
For now, I modified the add prototype for my testing.