Skip to content

Fix MONGOID-5136 .touch with custom field is broken for embedded documents #5039

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

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

p-mongo
Copy link
Contributor

@p-mongo p-mongo commented Aug 18, 2021

No description provided.

@p-mongo p-mongo changed the title MONGOID-5136 5136 Fix MONGOID-5136 .touch with custom field is broken for embedded documents Aug 18, 2021
@p-mongo
Copy link
Contributor Author

p-mongo commented Aug 18, 2021

https://jira.mongodb.org/browse/MONGOID-5136

end
end
{ "$set" => sets }
end
Copy link
Contributor

@johnnyshields johnnyshields Aug 18, 2021

Choose a reason for hiding this comment

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

Instead of doing this, how about adding atomic_touches as another element in Mongoid::Atomic::UPDATES? Then you can implement the solution in MONGOID-5142 when you resolve the atomic actions at the end, by merging it an existing $set update if one is available, or else creating a new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Johnny,

My thinking with this PR and 5142 was to repair the problem using the quicker solution so that, in particular, I could attend to the backlog of PRs (many of which are, as I see, created by you - thank you for that).

If you'd like to create a follow-up to this PR that addresses 5142 I'll appreciate it.

Copy link
Contributor

@johnnyshields johnnyshields Aug 18, 2021

Choose a reason for hiding this comment

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

Sure, I'll take a look at this tomorrow.

My pleasure creating the PRs. Your help to review them is greatly appreciated.

FYI in addition I'm going to look at:

Copy link
Contributor

Choose a reason for hiding this comment

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

Fix for MONGOID-5142 here: #5045, this PR can be closed.

@johnnyshields
Copy link
Contributor

johnnyshields commented Aug 20, 2021

@p-mongo --> fix for MONGOID-5142 here: #5045, I think you'll like it :)

This PR can be closed.

@p-mongo
Copy link
Contributor Author

p-mongo commented Aug 25, 2021

I would like this PR to be merged, in particular because it has tests, and then I'll be happy to review subsequent PRs.

@johnnyshields
Copy link
Contributor

johnnyshields commented Aug 25, 2021

OK... my PR includes your same tests, and this one causes a minor performance regression with extra queries, but go ahead and I'll do the extra work to revert it in my PR.

@p-mongo p-mongo merged commit 56ab615 into mongodb:master Aug 27, 2021
p-mongo added a commit that referenced this pull request Aug 27, 2021
…ments (#5039)

Co-authored-by: Oleg Pudeyev <code@olegp.name>
p-mongo pushed a commit to johnnyshields/mongoid that referenced this pull request Sep 10, 2021
* upstream/master: (27 commits)
  Create security policy following github's template (mongodb#5070)
  MONGOID-5131 Use proper mdb <-> ubuntu versions (mongodb#5067)
  MONGOID-5131: Set up build pipeline for outside contributors (mongodb#5043)
  MONGOID-5165 Fix documentation link (mongodb#5065)
  Fix indentation
  MONGOID-5029 #empty method should use an #exists? rather than a #count query (mongodb#5029)
  MONGOID-5177 Fix flaky contextual spec (mongodb#5064)
  MONGOID-5170 - Fix more typos mostly in code docs and code comments (mongodb#5056)
  MONGOID-5105 Allow block form in Mongoid::Association::EmbedsMany::Proxy#count  (mongodb#5060)
  MONGOID-5162 Add a release note for the planned changes in ObjectId#as_json (mongodb#5059)
  MONGOID-5171 - Make the minimum Ruby version 2.5 (mongodb#5058)
  MONGOID-5130 Remove conn count from client spec (mongodb#5055)
  Add driver 2.15 to compat table
  Fix MONGOID-5136 .touch with custom field is broken for embedded documents (mongodb#5039)
  MONGOID-5144 Add a deprecation warning when using the legacy query cache (mongodb#5042)
  MONGOID-???? Replace field[0] == ?$ with field.start_with?('$') -- easier to read and 30%+ faster (mongodb#5052)
  MONGOID-???? - Remove BSON::ObjectId#as_json as we will defer to the bson-ruby gem implementation. (mongodb#5057)
  MONGOID-4737 Deprecate the :compact option on Document#as_json (mongodb#5040)
  MONGOID-5143 [Code Comments Only] Remove magic comment "# encoding: utf-8" (mongodb#5041)
  Remove all @SInCE comments. These are generally not useful as: (mongodb#5037)
  ...
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.

4 participants