Following up on a closed github issue:
For all companies that are adopting the microservice infrastructure, all frontend components are gathering their data from multiple apis. The way Meteor is build closely couple the collections with one mongodb layer (for the benefits of being highly reactive).
The tutorials that are highlighting how to link an API always use a Mongo.Collection (so this.added behaves as expected). It seems like this method doesn’t store (at least now) the objects created. However, is there a way to build our own Collection mechanism: so all create, read, update, and delete operations can be forwarded to a distant API?
An example of an implementation is here: gist.github.com/xethorn/09da7e346956aab3af30
- Clicking on the button triggers the call to getPlayer but it removes the previous player and replace it with a new one (api.js contains no remove, just
- Routing (done with Iron) empties the collection.
- If you use
nullas a value for the collection name, the
this.addeddoes not work.
Am new to Meteor (started to look at it a few days ago). This might have been documented somewhere already, if you have examples that resolves this issue, I’d love to take a look.
(to see a screen capture: s27.postimg.org/sqjhgvjmr/gif.gif - you will see the number at 1 is Takei, 2 is Michael and 3 is nobody. 1 should be Takei, 2 should show Takei, Michael and 3 should be same as 2.)