Quin
Quin

Reputation: 541

How to publish all records in a meteor collection ... except one or two

I'm trying to publish all records in a Meteor collection except two. Let's say their document IDs are "abc" and "xyz." Does anyone know how to write that?

Upvotes: 1

Views: 95

Answers (1)

Tomas Romero
Tomas Romero

Reputation: 8708

Try:

Meteor.publish("my_pub", function() {
  return Something.find({ _id: { $nin: ['abc', 'xyz'] }})
})

Upvotes: 2

Related Questions