Skip to content

Conversation

Yoann-Abbes
Copy link
Contributor

@Yoann-Abbes Yoann-Abbes commented Jun 4, 2020

What does this PR do?

This PR adds document:updateByQuery to the sdk

Issue #518

How should this be manually tested?

  • Step 1 :
  • Step 2 :
  • Step 3 :
    ...

Other changes

Adds a new snippet template print-result-array.tpl.js

@Yoann-Abbes Yoann-Abbes self-assigned this Jun 4, 2020
@codecov
Copy link

codecov bot commented Jun 5, 2020

Codecov Report

❗ No coverage uploaded for pull request base (7-dev@d877d6f). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##             7-dev     #519   +/-   ##
========================================
  Coverage         ?   95.64%           
========================================
  Files            ?       32           
  Lines            ?     1308           
  Branches         ?        0           
========================================
  Hits             ?     1251           
  Misses           ?       57           
  Partials         ?        0           
Impacted Files Coverage Δ
src/controllers/Document.js 95.16% <100.00%> (ø)
src/protocols/WebSocket.js 100.00% <0.00%> (ø)
src/core/security/Role.js 80.00% <0.00%> (ø)
src/KuzzleError.js 100.00% <0.00%> (ø)
src/controllers/MemoryStorage.js 96.25% <0.00%> (ø)
src/controllers/Index.js 100.00% <0.00%> (ø)
src/controllers/Bulk.js 100.00% <0.00%> (ø)
src/protocols/abstract/PendingRequest.js 100.00% <0.00%> (ø)
src/controllers/Base.js 100.00% <0.00%> (ø)
src/core/searchResult/User.js 100.00% <0.00%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d877d6f...6fa8240. Read the comment docs.

[snippet-code] finally {
kuzzle.disconnect();
}
for (const elem of result.successes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only works with arrays returned by some of the m* methods. For example it wont works with document:search or document:mDelete.

You don't need to use this template also, you can just print the content of the result in JSON with newlines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this template could be useful, so I just renamed it print-result-successes as it do exactly that. So no confusion for route that wont return a successes array.

const request = {
index,
collection,
body: {...searchQuery, ...changes},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not work because every properties is at the same level instead of being inside the searchQuery and changes properties

Copy link
Contributor

@Aschen Aschen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant request change

@Yoann-Abbes Yoann-Abbes requested a review from Aschen June 5, 2020 10:14
@scottinet scottinet merged commit f51b9d3 into 7-dev Jun 6, 2020
@scottinet scottinet deleted the document-updateByQuery branch June 6, 2020 13:12
@scottinet scottinet mentioned this pull request Jul 23, 2020
scottinet added a commit that referenced this pull request Jul 23, 2020
# [7.3.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.3.0) (2020-07-23)


#### Bug fixes

- [ [#532](#532) ] Encode URI parameters when using the HTTTP protocol   ([scottinet](https://github.com/scottinet))
- [ [#516](#516) ] Fix query string construction   ([Yoann-Abbes](https://github.com/Yoann-Abbes))

#### New features

- [ [#526](#526) ] Add typescript definitions for Auth controller   ([Aschen](https://github.com/Aschen))
- [ [#524](#524) ] Support ms:mexecute   ([Leodau](https://github.com/Leodau))
- [ [#522](#522) ] Add bulk:deleteByQuery   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#519](#519) ] Add document:updateByQuery   ([Yoann-Abbes](https://github.com/Yoann-Abbes))

#### Enhancements

- [ [#517](#517) ] Add collection:update and deprecate collection:updateMapping   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
- [ [#514](#514) ] Able to execute document search as GET http method   ([Yoann-Abbes](https://github.com/Yoann-Abbes))
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants