Skip to content

Conversation

@agnes512
Copy link
Contributor

@agnes512 agnes512 commented Jul 7, 2020

fixes #532

Add a helper function that removes all extra dollar signs.
e.g $eq -> eq, $$eq -> eq ( don't consider the case as an error).

Screen Shot 2020-07-07 at 16 33 12

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@agnes512 agnes512 requested review from hacksparrow and jannyHou July 7, 2020 20:42
@agnes512 agnes512 requested review from dhmlau and emonddr as code owners July 7, 2020 20:42
lib/mongodb.js Outdated
while (spec.charAt(0) === '$') {
spec = spec.substr(1);
}
return spec;
Copy link
Contributor

Choose a reason for hiding this comment

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

The function can be simplified as follows:

function trimLeadingDollarSigns(spec) {
  return spec.replace(/^(\$)+/, '');
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed! Applied.

Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

👍 LGTM in general, just a few suggestions.

'$pop',
'$pullAll',
'$pull',
'$pushAll',
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason deleting this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@agnes512 agnes512 force-pushed the fix/filter branch 2 times, most recently from f696d89 to a978ae8 Compare July 10, 2020 17:00
@agnes512 agnes512 merged commit 319d5f0 into master Jul 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the fix/filter branch July 10, 2020 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MongoError: unknown operator: $$eq

4 participants