0

Assume that there is collectionA, collectionB. When I operate map reduce with collectionA collectionB, I kept the result in collectionC.

My problem is given below.

I want to update collectionC when collectionA or collectionB is updated, collectionC will be updated.

Are there any method to do this operation? In sql, I can do this operation with triggers on tables but I couldn't do this on MongoDB.

trallallalloo
  • 592
  • 1
  • 9
  • 25
  • Would be nice to see some examples to visualise the issue. – chridam May 25 '15 at 13:02
  • @chridam collectionA={id,name,age,birthdate}, collectionB={city_id, city_name, country} and after mapreduce collectionC={name, age, city_name, country}. For example when I update age in collectionA, age field in collectionC will be updated automatically. – trallallalloo May 25 '15 at 13:05
  • handle this from your application code or run a scheduler to update collectionC – Thaha kp May 25 '15 at 13:47
  • 1
    possible duplicate of [How to listen for changes to a MongoDB collection?](http://stackoverflow.com/questions/9691316/how-to-listen-for-changes-to-a-mongodb-collection) – Pio May 25 '15 at 14:23

0 Answers0