Hi Aurimas,
I'm not 100% on what you are trying to achieve, but I have taken this to mean you wish to have some form of external indexing. There are a few ways which i can see you attempting to go about this:
1) Try and find a way to structure your documents and queries to take advantage of mongoDB's existing indexing structure.
3) You may simply wish to build this into your application, so all queries execute a function to perform this kind of update after the document has been inserted into mongo
4) If you are familiar with C++ you can create your own fork of the mongoDB source code and modify as needed. It is available at
https://github.com/mongodb/mongo
Regards,
David