Hi!
Can you please explain more regarding what you want. I don't understand your request, and need some additional explanation. Here is what I seem to understand.
You are saying:
1. A user -- any user -- might query collection_a with a db.collection.find({}) query, coded like this and done in the Mongo shell:
db.collectiona.find( { "_id" : "000023" } )
Is the above correct? If not, how would the connected user be making the query, and what exactly will be coded in the db.collectiona.find()? Will the query be made using node.js, for example? If so, what version of node, exactly, and what version of the mongoldb driver for node.js are we talking about?
To continue. The user makes the above request, and what you want to do is: instead of showing the document with _id equal to "000023" in collectiona, you want to substitute some other document from a different collection?
Or do you want to transform whatever is returned for _id = "000023" in collectiona into a different output document?
If you really want _id = "000023" transformed into a completely new output document, how exactly should this transformation or reformatted document be created? It helps a lot to give step by step instructions, rather than just presenting a plain document with no commentary on how to build it.
I also do not really understand why you want to present the user with a "transformed" document instead of the original document that he or she is querying for, as a result of the db.collectiona.find({}). That point confuses me.
Also, what operating system would the MongoDB server be running on? You say you are using MongoDB server version 3.6. Can you tell me the full server version? I have 3.6.7 on my own machine. There have been a lot of fixes to the 3.6 series since 3.6.0 was released.
Do you have sample documents that illustrate what you want? If possible, could you provide small *.json files that show the "input" and "output" documents?
I can't promise to deliver what you want...but I know you have posted about this at least once before. Perhaps I can help, perhaps not. Perhaps with additional explanation of what you have in mind, it will be easier for other readers to help you, too.
Thanks so much
Bob