Closed greenwolfe closed 7 years ago
I'll have to take a close look at this. You're not the first to report an issue with regards to check
and collection-hooks. There's most likely nothing wrong with your code.
+1 Thx!
any news on this?
sorry for bumping, it was my fault. used check('nameOfParam', pattern)
instead of check(nameOfParam, pattern)
Any news on this? I'm still getting it and don't quite get why. I'm not doing any checks on the Publication.
I20160817-05:46:51.308(-6)? Exception from sub chat id yd2sPdbCA5tTMWZmE Error: Match error: Failed Match.OneOf, Match.Maybe or Match.Optional validation
I20160817-05:46:51.310(-6)? at exports.check (packages/check/match.js:34:1)
I20160817-05:46:51.310(-6)? at [object Object]._getFindOptions (packages/mongo/collection.js:277:7)
I20160817-05:46:51.310(-6)? at [object Object].find (packages/mongo/collection.js:316:39)
I20160817-05:46:51.310(-6)? at Subscription.<anonymous> (server/server.js:9:17)
I20160817-05:46:51.310(-6)? at packages/matb33_collection-hooks/collection-hooks.js:281:1
I20160817-05:46:51.311(-6)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20160817-05:46:51.311(-6)? at Subscription._handler (packages/matb33_collection-hooks/collection-hooks.js:280:1)
I20160817-05:46:51.311(-6)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1711:12)
I20160817-05:46:51.311(-6)? at Subscription._runHandler (packages/ddp-server/livedata_server.js:1026:17)
I20160817-05:46:51.311(-6)? at Session._startSubscription (packages/ddp-server/livedata_server.js:845:9)
I20160817-05:46:51.315(-6)? Sanitized and reported to the client as: Match failed [400]
I20160817-05:46:51.316(-6)?
I'm finding that it only gives this error if you have a limit
in your query. When I take out the limit
, it works just fine.
I also just uninstalled your package and tried it again and I get the same error, so I don't think it has anything to do with your package after all. It just references it in the stack trace because it is tied into collections. I'll try to narrow down what's causing this.
My pub for the sake of documentation.
Meteor.publish("chat", function (lng, lat, limit) {
return Chat.find({loc: {$geoWithin:{$center: [[lng, lat], 20]}}}, {limit: limit}, {fields: {'_id': 1, 'sender': 1, 'message': 1, 'createdAt': 1}});
});
So it seems that both the issues in here was coding mistakes so I'm closing this.
I am getting the following error, which seems related to something in collection hooks and I can't figure it out.
I20150815-11:46:11.903(-4)? Exception from sub walls id pB9xvAkv5DQmRmYdL Error: Match error: Expected string, got object I20150815-11:46:11.920(-4)? at checkSubtree (packages/check/match.js:220:1) I20150815-11:46:11.919(-4)? at [object Object].condition (app/methods/MatchHelpers.js:2:5) I20150815-11:46:11.917(-4)? at checkSubtree (packages/check/match.js:159:1) I20150815-11:46:11.918(-4)? at check (packages/check/match.js:32:1) I20150815-11:46:11.920(-4)? at check (packages/check/match.js:32:1) I20150815-11:46:11.920(-4)? at [object Object].Meteor.publish.Columns.find.wallID (app/server/publications.js:79:3) I20150815-11:46:11.922(-4)? at packages/matb33:collection-hooks/collection-hooks.js:218:1 I20150815-11:46:11.923(-4)? at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) I20150815-11:46:11.923(-4)? at [object Object]._handler (packages/matb33:collection-hooks/collection-hooks.js:217:1) I20150815-11:46:11.923(-4)? at packages/check/match.js:109:1 I20150815-11:46:11.924(-4)? Sanitized and reported to the client as: Match failed [400] I20150815-11:46:11.926(-4)?
The id given in the error message (pB9xvAkv5DQmRmYdL) does not occur anywhere in my database as far as I can tell.
at app/server/publications:79:3 I have
Line 79 is the last line above.
There's only one subscription call to this publish function:
I have also checked student ID and I am definitely passing in an id string and not an object.
As far as as [object Object].Meteor.publish.Columns.find.wallID. I have
app/server/publications starting at :99
There is also only one subscription call to this publish function
I have checked instance.data._id and it is a valid id string and not an object.
At app/methods/MatchHelpers.js:2:5 I have:
Is this something in collection hooks as it appears, or have I done something wrong? My code appears to run properly despite the error. Any help understanding and resolving it is appreciated.