-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR should include an entry in CHANGES_NEXT_RELEASE file describing the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 39c7874
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As the mongoose docs state: