Closed cyclops24 closed 7 years ago
Well, hooks are happening in the app level not at the database level. That means that it does not matter whether you link to apps via the same database. Hooks wrote in app "A" will be run when the app "A" makes a call to collections.notes.update
. Hooks written in app "B" will only be called when app "B" makes a call to collections.notes.update
.
@namirsab, Oh man. It's a good note. So this is normal with collection-hook. @namirsab can you suggest any working way for my situation? Or maybe some keyword for searching about this.
@cyclops24 there are several possibilities.
Another solution could be to write a data-layer app you will use to mutate your data. This app will give the other apps an API to change the data, and internally this will be the only one that will have the hooks.
As you can see there are some possibilities, but you need to analyze your case and then decide.
i hope it helps :smile:
I close the issue because i think its solved :smile:
Thanks @namirsab , You save me man. 😉
Hi guys, I have an application written with Meteor 1.4 and run it on port 3000 (called A) know I want use A application database in another application (called B). In B console I set MONGO_URL like this:
And then run that on port 5000. I have some collection hook on app A and also some collection hook on app B but hooks only called in app A.
For example in A we have:
And in B we have:
But it's only log
notes updated in A hook
.How to fix it?
Related StackOverflow question Related Forum question
/cc: @matb33 /cc: @evliu /cc: @nate-strauser /cc: @mizzao