If I add an API endpoint that saves data to a Mongo collection, does Meteor sniff that out automatically?

Let’s say I have a simple Meteor collection and I expose an API endpoint that writes to MongoDB. Will Meteor sniff that update out automatically and push the change to connected clients?

// Imagine this is my API:

function insertPerson(person) {
  var personId = People.insert(person);
}

Yep! You can test this out yourself by opening the meteor mongo console and typing a mongoDB query. Meteor picks up changes through the database just fine!

So theoretically, I can build an API with whatever I want; say Go, and as long as I save the data to the database, Meteor will pick that up and update the UI?

That’s amazing. :rocket:

1 Like

tail -f oplog

(okay, not quite!)

http://www.manuel-schoebel.com/blog/meteorjs-and-mongodb-replica-set-for-oplog-tailing