Sort nested fields cross parent documents

Hi,
We have a model that looks something like this:

Order: {
properties: {
	...
	shipments: {
		type: "nested",
		properties: {
			...
			deliveryDate: {
				type: "date"
			},
		}

	}
}

}

We need to be able to search all orders with a given criterias and return a list of shipments sorted by date. The problem we are facing is that an order may have multiple shipments with different delivery dates. If we fetch all orders and then sort the shipments, it would work, but that does not work very well when we have a huge amount of orders.
Any ideas?
Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.