Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
95139ac8
Unverified
Commit
95139ac8
authored
4 months ago
by
gabriellsh
Committed by
GitHub
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
regression: Minimongo queries with operator matching only first found _id (#33848)
parent
7c45f830
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/meteor/packages/meteor-run-as-user/lib/collection.overwrites.js
+37
-0
37 additions, 0 deletions
.../packages/meteor-run-as-user/lib/collection.overwrites.js
apps/meteor/packages/meteor-run-as-user/package.js
+1
-0
1 addition, 0 deletions
apps/meteor/packages/meteor-run-as-user/package.js
with
38 additions
and
0 deletions
apps/meteor/packages/meteor-run-as-user/lib/collection.overwrites.js
+
37
−
0
View file @
95139ac8
// TODO: Remove this after meteor fixes the issue
// This override fixes a recent issue introduced after the update to Meteor 3.0
// MinimongoCollection.remove(query) where `query` has `_id: { $in: Array }` removes only the first found record.
LocalCollection
.
prototype
[
'
_eachPossiblyMatchingDocAsync
'
]
=
async
function
(
selector
,
fn
)
{
const
specificIds
=
LocalCollection
.
_idsMatchedBySelector
(
selector
);
if
(
specificIds
)
{
for
(
const
id
of
specificIds
)
{
const
doc
=
this
.
_docs
.
get
(
id
);
if
(
doc
&&
(
await
fn
(
doc
,
id
))
===
false
)
{
// Changed from `!fn(doc,id)`
break
}
}
}
else
{
await
this
.
_docs
.
forEachAsync
(
fn
);
}
}
LocalCollection
.
prototype
[
'
_eachPossiblyMatchingDocSync
'
]
=
function
(
selector
,
fn
)
{
const
specificIds
=
LocalCollection
.
_idsMatchedBySelector
(
selector
);
if
(
specificIds
)
{
for
(
const
id
of
specificIds
)
{
const
doc
=
this
.
_docs
.
get
(
id
);
if
(
doc
&&
fn
(
doc
,
id
)
===
false
)
{
// Changed from `!fn(doc,id)`
break
}
}
}
else
{
this
.
_docs
.
forEach
(
fn
);
}
}
// This file overwrites the default metoer Mongo.Collection modifiers: "insert",
// "update", "remove"
//
...
...
@@ -44,3 +79,5 @@ _.each(['insert', 'update', 'remove'], function (method) {
return
_super
.
apply
(
self
,
args
);
};
});
This diff is collapsed.
Click to expand it.
apps/meteor/packages/meteor-run-as-user/package.js
+
1
−
0
View file @
95139ac8
...
...
@@ -14,6 +14,7 @@ Package.onUse(function (api) {
'
underscore
'
,
'
mongo
'
,
'
ddp
'
,
'
minimongo
'
,
// 'ddp-common',
// 'ddp-client'
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment