Check package throws error on standard find query


#1

Hi.

I have added the check package.
Ever since many subscriptions are throwing errors on harmless queries.

For example:

Notifications.find({userId: this.userId}, { sort: { date: -1 }, limit: 30 });

Throws:

Exception from sub noti id j8gzqRRW254bczaPZ Error: Match error: Failed Match.OneOf or Match.Optional validation
at checkSubtree (packages/check/packages/check.js:252:1)
at check (packages/check/packages/check.js:40:1)
at [object Object]._.extend._getFindOptions (packages/mongo/collection.js:244:1)
at [object Object]._.extend.find (packages/mongo/collection.js:280:1)
at [object Object].eval [as _handler] (eval at <anonymous> (server.js:1320:1), <anonymous>:20:50)
at maybeAuditArgumentChecks (livedata_server.js:1692:12)
at [object Object]._.extend._runHandler (livedata_server.js:1023:17)
at [object Object]._.extend._startSubscription (livedata_server.js:842:9)
at [object Object]._.extend.protocol_handlers.sub (livedata_server.js:614:12)
at livedata_server.js:548:43
Sanitized and reported to the client as: Match failed [400]

Any idea what can be the problem?
Thanks

EDIT: I’ve found out that removing the search options make the find query work. But why? This works: return Notifications.find({userId: this.userId});


#2

Hi!
I’ve got this error today every time I tried to use limit in query options at server-side. I’m using webpack:webpack and after some hours of investigation, I found that removing babel polifill solves this issue for me.

Hope this helps.