Meteor aggregation TypeError: cannot read property

I have a publish function which does an aggregation which I am converting from an array to a collection:

Meteor.publish("Jobsnohelpers", function (args) {
    var sub = this;

    var pipeline = [
         { $lookup:
         {
            from: "Helperjobs",
            localField: "job",
            foreignField: "_id",
            as: "temp"
        }},
           { 
               $match: 
               {"temp.Helpername": {$exists: false }}

           },

    Jobs.aggregate(
        pipeline,
        Meteor.bindEnvironment(
            function(err, result) {
            _.each(result, function(e) {
                    sub.added("Jobsnohelpers", Random.id(), 
                    {
                        ShortDesc: e._id,
                        LongDesc: "Hello this is a test",
                        LongDesc: e.LongDesc

                    }
                    );
                });
               sub.ready();
            },
            function(error) {
                Meteor._debug( "Error doing aggregation: " + error);
            }
        )
    );
});

When I run it. I get

Error doing aggregation: TypeError: Cannot read property '_id' of null

Also, I am developing on AWS Cloud 9. I wonder if that is creating an issue?

Meteor aggregation changed in a recent update in 1.7.1 The mongo aggregate function returns a different value now. It used to return a cursor now it returns a promise if I recall correctly.

The fix is to add .toArray() to the end of the original aggregate call and the behaviour is as it was before.

Mongo added this breaking change not meteor.

[Solved] rawCollection aggregate; TypeError: Cannot read property , err TypeError: Cannot read property 'name' of undefined at Collection.aggregate (/home/george/.meteor/packages/npm-mongo/.3.1.1.v3rpzk.m5kk8++os+web. ️ TypeError: Cannot read property 'constructor' of undefined Meteor version: latest build : 1.8.1 OS: Mac OS Mojave Description: After upgrading from Meteor 1.7 to 1.8.1 I get the Skip to content

This could be related to the fact that meteorhacks version of aggregate isn't supported by Meteor 1.7. Try this fork thats been modified to work with it: https://github.com/sakulstra/meteor-aggregate

For more details: https://github.com/meteorhacks/meteor-aggregate/issues/47

Cannot read property 'collectionName' of undefined · Issue #3 , (STDERR) TypeError: Cannot read property 'get' of undefined W20170712-18:38:​41.578(-4)? (STDERR) at withoutInvocation (packages/meteor.js:443:33)  Meteor 1.5: TypeError: Cannot read property '0' of undefined #8740. joshuadavidson opened this issue Jun 1, 2017 · 7 comments Milestone. Release 1.5.2. Comments.

I ended up scrapping aggregation and instead restructured the DB. I am not sure exactly what was going on with the event variable coming up null. Instead of using a mapping table I used subdocuments to model the one to many relationship. Ultimately, after experiencing a lot of frustration with Meteor aggregation, I think this is the right approach since it conforms with the conceptual model of Object Oriented databases.

[Solved]meteor [1.5][MacOS] TypeError: Cannot read property 'get' of , disabled bootstrap; and got Uncaught TypeError: Cannot read property '​onCreated' of undefined. although am thinking the error is somewhere completely  Uncaught TypeError: Cannot read property 'get' of undefined in polyfill:3 After update to 1.5.1 and a clean npm install the problem was solved. This comment has been minimized.

meteor/meteor, Getting error cannot read property 'stripe' of undefined (Meteor) - node.js. and I installed them. But it crashes with the following logs: TypeError: Cannot read property 'toString' of undefined at Function.module.exports.aggregate  These events are stored in a collection called events updated by triggerJob. At the end of the triggers loop, a map reduce is ran. It acts on the collection of events and replaces the collection called eventStats. The bug occurs only after a while; approximatly 30 events or so.

Getting error cannot read property 'stripe' of undefined (Meteor , You cannot specify a $text query expression in an $elemMatch . Examples¶. Element Match¶. Given the following documents in the scores collection: copy. Unfortunately I cannot run a local --production flag right now to try and reproduce the results with a simple app that I can publish to gitHub.

$elemMatch (query), readPreference {String}, the prefered read preference (ReadPreference. write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with Execute an aggregation framework pipeline against the collection, needs​  TypeError: Cannot read property 'slice' of null. meteor,meteor-autoform,meteoric. This is a issue with the new patch for autoform-ionic to the new versions of autoform. Apparently some labels are skipped, some not (see here).

Comments
  • Which line of the file does the error come fomr
  • the error is coming from: ShortDesc: e._id,
  • @user8578092 which package are u using for aggregate also you should check for the error before working with the result.
  • meteorhacks:aggregate 1.3.0. Thanks for the error heads up.