This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 12, 2012, 4:49 AM
18 Posts

Document sorting in SSJS without using treemap

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags:
  • Replies: 2
 Hi All,
 
I want to sort a collection of documents by a particular fields name in SSJS without using treemap.  As treemap uses key value n if i pass the fieldname as the key value and there more than one documents by that key value(consider  a date field as the key so if there more than one document with the same date) then treemap will consier only the first document so unable to use treepmap..
 
 
Thanks in advance!!!! 
Jun 12, 2012, 7:06 AM
135 Posts
Re: Document sorting in SSJS without using treemap
Hi,
 
make a 2-dimensional array and put the key there as the first item and document position/index in collection as the second item. Then just sort that array by the key.
- Panu  
Jun 12, 2012, 7:37 AM
126 Posts
Re: Document sorting in SSJS without using treemap
why not simply create a view and select ascending / descending in the sort options on a column ?
 
It will offer much better performance than doing it manually with SSJS 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal