mongo: simplify matcher error handling in MongoConnection

This commit is contained in:
italo jose
2025-06-17 16:58:43 -03:00
committed by Italo José
parent ee3d0e3e0e
commit 1e8e3cf0ea

View File

@@ -804,7 +804,7 @@ Object.assign(MongoConnection.prototype, {
cursorDescription, ordered, callbacks, nonMutatingCallbacks) {
var self = this;
const collectionName = cursorDescription.collectionName;
if (cursorDescription.options.tailable) {
return self._observeChangesTailable(cursorDescription, ordered, callbacks);
}
@@ -880,14 +880,8 @@ Object.assign(MongoConnection.prototype, {
function () {
// We need to be able to compile the selector. Fall back to polling for
// some newfangled $selector that minimongo doesn't support yet.
try {
matcher = new Minimongo.Matcher(cursorDescription.selector);
return true;
} catch (e) {
// XXX make all compilation errors MinimongoError or something
// so that this doesn't ignore unrelated exceptions
return false;
}
matcher = new Minimongo.Matcher(cursorDescription.selector);
return !!matcher;
},
function () {
// ... and the selector itself needs to support oplog.