Hi,
This is more of an add-on request for the aggregate().
Lets say we have two clusters , second clusters is derived from first cluster ( i-e some of the object ids in second cluster exist only in first cluster ).
Now I want to do a lookup for the id in the first cluster from the second cluster , which is not possible.
So , can we have another optional parameter in the aggregate function which allows us to pass the documents , over which we can apply the required stages ( i-e after using find() on cluster 2 , I will pass the result into an aggregate() call for cluster 1 ).
example query ->
db1 points to cluster1
db2 point to cluster2.
I am working on Node.js -
let result=[];
let response = await db2.find().forEach(item=>{
result.push(item);
});
let lookupResponse = await db1.aggregate([],{},result);
Here in the second query , the documents in which the aggregate stages should work
is the documents present in the variable 'result'.
I hope I was able to explain my idea.
It would really help if this is added in the next update.
Thanks,
Dushyant.