Update MongoDB to use lean()#999
Conversation
|
Extraction of |
| @@ -188,26 +188,11 @@ function listDevices(type, service, subservice, limit, offset, callback) { | |||
| }); | |||
There was a problem hiding this comment.
PR should include an entry in CHANGES_NEXT_RELEASE file describing the change.
| for (let i = 0; i < attributes.length; i++) { | ||
| if (body[attributes[i]] !== undefined) { | ||
| group[attributes[i]] = body[attributes[i]]; | ||
| attributeList.forEach((key) => { |
There was a problem hiding this comment.
Until this resource was not able to be updated. With this resource could be updated. Not sure if is desirable.
There was a problem hiding this comment.
If you really want separately maintained lists for create and update, at least bring these out as constants at the head of the file. The current position where they are buried in the middle of the file means that they are more likely to get out of sync. Difficult to decide if this is a deliberate decision or someone missed an entry in a list.
It also means a new array is created and destroyed for every update. I'm happy to re-alter the functionality here, but I'd like a clear and definite plan.
There was a problem hiding this comment.
apikey and resource are keys to updae and delete a device group.
Sometime ago apikey and resource where not able to be modified. Currently apikey could be modified, so I don't see a reason to resource couldn't be modified.
As the mongoose docs state: