DavidTanner / nodecredstash

MIT License
43 stars 22 forks source link

Limit not respected in getAllVersions() #26

Closed mschoendorf closed 6 years ago

mschoendorf commented 6 years ago

Calling the code:

credstash.getAllVersions({ name, limit });

For a test value that has 4 versions in the

[ { version: '0000000000000000004', secret: 'default4' }, { version: '0000000000000000003', secret: 'default3' }, { version: '0000000000000000002', secret: 'default2' }, { version: '0000000000000000001', secret: 'default' } ]

When I call this function with limit 2, I still get back all 4 results.

DavidTanner commented 6 years ago

The limit actually refers to how many results will come back for each call to dynamo. The library automatically pages the results though, so you should always get all versions.

mschoendorf commented 6 years ago

Thanks for the explanation!