meteor-restivus icon indicating copy to clipboard operation
meteor-restivus copied to clipboard

Cannot get all records from a collection..

Open ChanceTheMaker opened this issue 9 years ago • 1 comments

I can retrieve a single record but when I try to get all records I get the following error... { "error": "internal-server-error", "reason": "Internal server error" }

Here is the code that errors,,, Api.addRoute('allGuests', {authRequired: false}, { get: function () { var records = Guests.find({}); if(records != null) { console.log(records); return records; }
} });

I also tried Guests.find({}).fetch();

This code works for one record... Api.addRoute('guests/:id', {authRequired: false}, { get: function () { var record = Guests.findOne(this.urlParams.id); if(record != null) { return record; } } });

ChanceTheMaker avatar Feb 22 '16 07:02 ChanceTheMaker

I seems like my collection was too big and it was running out of memory. i tried a smaller colection and it worked.

ChanceTheMaker avatar Feb 22 '16 07:02 ChanceTheMaker