You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this package to create an aggregation of a huge data coming from 'https://publicinfobanjir.water.gov.my/wp-content/themes/enlighten/data/latestreadings.json', trimming the data to aggregate the latest (current day) record and publish it via the Meteor publish. I encountered two errors i.e. one that days 'unrecognised expression' and the other on something about sanitization and reported to the client as an error.
Situation: (Refer to 'Current Result' section below for details on the errors):
Error 1 occurs on both localhost and on Meteor Galaxy.
Error 2 only occurs on Meteor Galaxy, works fine on localhost.
Context
The system that I am building is showing current rainfalls and river water levels in Malaysia. The data is siphoned JSON endpoint from 'https://publicinfobanjir.water.gov.my/wp-content/themes/enlighten/data/latestreadings.json' and the data is fetched using meteor/fetch module, every 15 minutes (cron job using wildhart:jobs). The data is then saved into MongoDB. I then created a publish function to have reactive access to the data, and I used tunguska-reactive-aggregate package in the publish function. After that, I subscribe to the publication on the frontend via React Context API.
Process
The publication function (link to SO original answer, which I tweaked to fit my use case):
The result should be an array of objects that contains the aggregated data.
Current result
Instead, I encountered these error messages in the console:
Error 1.
Sanitized and reported to the client as: Error: tunguska:reactive-aggregate [Error]
xzxt32022-04-16 13:38:07+08:00 at errorClass.<anonymous> (packages/tunguska:reactive-aggregate/aggregate.js:11:27)
xzxt32022-04-16 13:38:07+08:00 at new errorClass (packages/meteor.js:660:17)
xzxt32022-04-16 13:38:07+08:00 at update (packages/tunguska:reactive-aggregate/aggregate.js:267:13)
xzxt32022-04-16 13:38:07+08:00 at ReactiveAggregate (packages/tunguska:reactive-aggregate/aggregate.js:334:3)
xzxt32022-04-16 13:38:07+08:00 at Subscription.<anonymous> (server/main.js:151:7)
xzxt32022-04-16 13:38:07+08:00 at packages/matb33:collection-hooks/server.js:33:71
xzxt32022-04-16 13:38:07+08:00 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
xzxt32022-04-16 13:38:07+08:00 at Subscription._handler (packages/matb33:collection-hooks/server.js:33:26)
xzxt32022-04-16 13:38:07+08:00 at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1885:12)
xzxt32022-04-16 13:38:07+08:00 at packages/ddp-server/livedata_server.js:1107:9
xzxt32022-04-16 13:38:07+08:00 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
xzxt32022-04-16 13:38:07+08:00 at Subscription._runHandler (packages/ddp-server/livedata_server.js:1106:60)
xzxt32022-04-16 13:38:07+08:00 at Subscription.subscriptionProto._runHandler (packages/mdg:meteor-apm-agent/lib/hijack/wrap_subscription.js:12:24)
xzxt32022-04-16 13:38:07+08:00 at Session._startSubscription (packages/ddp-server/livedata_server.js:917:9)
xzxt32022-04-16 13:38:07+08:00 at Session.sub (packages/ddp-server/livedata_server.js:673:12)
xzxt32022-04-16 13:38:07+08:00 at packages/mdg:meteor-apm-agent/lib/hijack/wrap_session.js:77:34
xzxt32022-04-16 13:38:07+08:00 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
xzxt32022-04-16 13:38:07+08:00 at Session.sessionProto.protocol_handlers.sub (packages/mdg:meteor-apm-agent/lib/hijack/wrap_session.js:76:44)
xzxt32022-04-16 13:38:07+08:00 at packages/ddp-server/livedata_server.js:603:43
and Error 2.
Exception from sub PIBDataAlerts id Q7QrEg8nzQdesitib Error: Unrecognized expression '$dateTrunc'xzxt3
2022-04-16 13:38:07+08:00 at update (packages/tunguska:reactive-aggregate/aggregate.js:267:13)xzxt3
2022-04-16 13:38:07+08:00 at ReactiveAggregate (packages/tunguska:reactive-aggregate/aggregate.js:334:3)xzxt3
2022-04-16 13:38:07+08:00 at Subscription.<anonymous> (server/main.js:151:7)xzxt3
2022-04-16 13:38:07+08:00 at packages/matb33:collection-hooks/server.js:33:71xzxt3
2022-04-16 13:38:07+08:00 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)xzxt3
2022-04-16 13:38:07+08:00 at Subscription._handler (packages/matb33:collection-hooks/server.js:33:26)xzxt3
2022-04-16 13:38:07+08:00 at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1885:12)xzxt3
2022-04-16 13:38:07+08:00 at packages/ddp-server/livedata_server.js:1107:9xzxt3
2022-04-16 13:38:07+08:00 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)xzxt3
2022-04-16 13:38:07+08:00 at Subscription._runHandler (packages/ddp-server/livedata_server.js:1106:60)xzxt3
2022-04-16 13:38:07+08:00 at Subscription.subscriptionProto._runHandler (packages/mdg:meteor-apm-agent/lib/hijack/wrap_subscription.js:12:24)xzxt3
2022-04-16 13:38:07+08:00 at Session._startSubscription (packages/ddp-server/livedata_server.js:917:9)xzxt3
2022-04-16 13:38:07+08:00 at Session.sub (packages/ddp-server/livedata_server.js:673:12)xzxt3
2022-04-16 13:38:07+08:00 at packages/mdg:meteor-apm-agent/lib/hijack/wrap_session.js:77:34xzxt3
2022-04-16 13:38:07+08:00 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)xzxt3
2022-04-16 13:38:07+08:00 at Session.sessionProto.protocol_handlers.sub (packages/mdg:meteor-apm-agent/lib/hijack/wrap_session.js:76:44)xzxt3
2022-04-16 13:38:07+08:00 at packages/ddp-server/livedata_server.js:603:43
The text was updated successfully, but these errors were encountered:
What version of Meteor are you using (in dev and production)? The MongoDB documentation for $dateTrunc states that it is new in v5, which is only supported in Meteor v2.6 and above.
I use this package to create an aggregation of a huge data coming from 'https://publicinfobanjir.water.gov.my/wp-content/themes/enlighten/data/latestreadings.json', trimming the data to aggregate the latest (current day) record and publish it via the Meteor publish. I encountered two errors i.e. one that days 'unrecognised expression' and the other on something about sanitization and reported to the client as an error.
Situation: (Refer to 'Current Result' section below for details on the errors):
Context
The system that I am building is showing current rainfalls and river water levels in Malaysia. The data is siphoned JSON endpoint from 'https://publicinfobanjir.water.gov.my/wp-content/themes/enlighten/data/latestreadings.json' and the data is fetched using meteor/fetch module, every 15 minutes (cron job using
wildhart:jobs
). The data is then saved into MongoDB. I then created a publish function to have reactive access to the data, and I used tunguska-reactive-aggregate package in the publish function. After that, I subscribe to the publication on the frontend via React Context API.Process
Expected result
The result should be an array of objects that contains the aggregated data.
Current result
Instead, I encountered these error messages in the console:
Error 1.
and Error 2.
The text was updated successfully, but these errors were encountered: