Meteor Find is returning all records!

I’ve started a new Meteor project, and for some reason, in server.js I’m getting ALL documents returned!


return Posts.find({ type:“messages” }, {sort: { createdAt: -1 },limit:6} );

I’m getting over 200 messages pulled back! What the heck?

On my /client/templates/messages.js helper, I can do the limit here, and it works, but I’m still subscribed to ALL that data!

I am copy and pasting code from my other Meteor project that doesn’t have this problem. Auto publish is removed… what’s going on?!

Wow! I had a bad data return in a previous line of code that was throwing this out the window!

Like most debugging, go back and turn off other code to isolate your issue.

1 Like