Skip to content
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

docs(script): add script to remove permissionList.read key from the db #2190

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Jun 16, 2021

Problem

Script to remove permissionList.read key from the database.
The key is already removed from the schema, so old/new clients should not matter.
Any updates by old forms (with the deprecated key already saved in client) will not affect the database.

Related to #2177

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
  • No - this PR is backwards compatible

Deploy Notes

New scripts:

  • add script to remove permissionList.read key from the database.

@karrui karrui requested review from mantariksh and yong-jie June 16, 2021 08:08

// Number of forms with permissionList.read key - expect 0 after running update
db.forms.count({
permissionList: { $elemMatch: { read: { $exists: true } } }
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to change but this is equivalent to 'permissionList.read': { $exists: true }

Comment on lines +28 to +29
{ $unset: { 'permissionList.$[elem].read': 1 } },
{ arrayFilters: [{ 'elem.read': { $exists: true } }], multi: true }
Copy link
Contributor

Choose a reason for hiding this comment

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

again no need to change but this is equivalent to this:

Suggested change
{ $unset: { 'permissionList.$[elem].read': 1 } },
{ arrayFilters: [{ 'elem.read': { $exists: true } }], multi: true }
{ $unset: { 'permissionList.$[].read': 1 } },
{ multi: true }

@mantariksh mantariksh merged commit a4207a8 into develop Jun 17, 2021
@karrui karrui deleted the script/remove-permissionList-read branch June 17, 2021 10:14
@tshuli tshuli mentioned this pull request Jun 22, 2021
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.

2 participants