When in doubt... flatten. Actually, in this case, you may simply need to store 
a little more of your product data for each sales document. Then you can just 
query on the sales collection.

Or... just store the product ID/key with each sales transaction and then do a 
second query to get the product data given a list of the product keys for the 
sales items to be displayed.

Your choice.

-- Jack Krupansky

From: Jilani Shaik 
Sent: Wednesday, June 26, 2013 8:57 AM
To: [email protected] 
Subject: Get the query result from one collection and send it to other 
collection to for merging the result sets

Hi, 
We will have two categories of data, where one category will be the list of 
primary data (for example products) and the other collection (it could be 
spread across shards) holds the transaction data (for example product sales 
data). 



We have search scenario where we need to show the products along with the 
number of sales for each product. For this we need to do a facet based search 
on second collection and then this has to shown together along with the primary 
data.



Is there any way to handle this kind of scenario. Please suggest any other 
approaches to get the desired result.



Thank you,
Jilani

Reply via email to