How to use find and a callback in Meteor
find doesn't take a callback as a parameter.
On the client, find
is synchronous so the callback is unnecessary. On the server, find
appears synchronous due to meteor's use of fibers.
Either way, you want something like this:
let posts = Posts.find({_id: {$ne: ls._id}}).fetch();console.log(posts);
See common mistakes for more details on find
and fetch
.