Azure / azure-cosmosdb-js-server

The JavaScript SDK for server-side programming in Azure Cosmos DB
MIT License
179 stars 152 forks source link

add bulkDelete_underscoreAPI.js and count_underscoreAPI.js to stored procedures samples #5

Open dwhieb opened 8 years ago

dwhieb commented 8 years ago

Just following up - any movement on this PR? Thanks!

rnagpal commented 8 years ago

@dwhieb : Sorry for the delay. I've asked the respective owners to take a look at it.

dwhieb commented 8 years ago

No worries - thanks!

emilylawton commented 8 years ago

Thanks, @dwhieb! These samples are great. Our bank of stored procedure samples currently includes Count.js which performs a document count with an optional filter and bulkDelete.js which deletes documents for a given query. What additional functionality did you want to add with clear.js and length.js?

dwhieb commented 8 years ago

Well for both sprocs I added the option to pass a key and value to filter on. And for count.js I used the collection's .filter() method, which seemed a little more straightforward since I was in fact filtering.

I'd be happy to incorporate these changes into the sprocs already in the repo if that'd be better. And in retrospect I think passing a filter object rather than two arguments would be a better way to structure the filter option.

koltachev commented 8 years ago

Thanks for reaching out! I think since these are using underscore API it would make sense to keep them this way. There is a couple of issues which is not a big deal -- I'll add a few comments.

dwhieb commented 8 years ago

Great! I'll tackle these changes now.

dwhieb commented 8 years ago

@koltachev Ok I've added my revisions to the PR and addressed each of your comments (I noted the commit for each), as well as changed the way the filter parameter is structured, so that the sprocs now take a single (optional) filter object as an argument.

dwhieb commented 7 years ago

@mkolt Should be all set!