{"id":8507,"date":"2012-09-25T01:32:42","date_gmt":"2012-09-24T20:02:42","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=8507"},"modified":"2022-01-13T16:47:56","modified_gmt":"2022-01-13T11:17:56","slug":"sorting-list-with-nulls-as-higher-value","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/","title":{"rendered":"Sorting list with nulls as higher value"},"content":{"rendered":"<p>I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration :<\/p>\n<p>[groovy]<\/p>\n<p>List&amp;lt;String&amp;gt; animals=[&amp;quot;Monkey&amp;quot;, null, &amp;quot;Ape&amp;quot;, null, &amp;quot;Tiger&amp;quot;, &amp;quot;Lion&amp;quot;]<\/p>\n<p>println animals.sort()              \/\/ [null, null, Ape, Lion, Monkey, Tiger]<br \/>\nprintln animals.sort().reverse()\t\/\/ [Tiger, Monkey, Lion, Ape, null, null] <\/p>\n<p>[\/groovy]<\/p>\n<p style='padding-bottom:10px;'>\nYou can see that nulls are lower in default groovy sorting.\n<\/p>\n<p style='padding-bottom:10px;'>\nWhat if we wanted to treat null as higher. In other words: Sort null values at the bottom in case of Ascending order and Sort null values at the top in case of Descending.<\/p>\n<p><p style='padding-bottom:10px;'>\n<a href=\"http:\/\/mvnrepository.com\/artifact\/commons-collections\/commons-collections\/3.2.1\">Apache commons-collections jar file <\/a> contains a utility Comparator class : NullComparator. This class can be used to change the high\/low interpretation of null values in sorting. Here is the sample code to see the NullComparator in action. (Note that this jar file is already included in grails library. Use grab to include this jar file when you are running code in groovy console).<\/p>\n<p>\n[groovy]<\/p>\n<p>@Grab(group=&#8217;commons-collections&#8217;, module=&#8217;commons-collections&#8217;, version=&#8217;3.2.1&#8242;)<br \/>\nimport org.apache.commons.collections.comparators.NullComparator<br \/>\n\/\/ public NullComparator(boolean nullsAreHigh)<\/p>\n<p>def nullHigh = new NullComparator(true)<br \/>\nprintln animals.sort{a, b-&amp;gt; nullHigh.compare(a, b)}  \/\/ [Ape, Lion, Monkey, Tiger, null, null]<br \/>\nprintln animals.sort{b, a-&amp;gt; nullHigh.compare(a, b)}  \/\/ [null, null, Tiger, Monkey, Lion, Ape]<\/p>\n<p>def nullLow = new NullComparator(false)<br \/>\nprintln animals.sort{a, b-&amp;gt; nullLow.compare(a, b)} \/\/ same as animals.sort()<br \/>\nprintln animals.sort{b, a-&amp;gt; nullLow.compare(a, b)} \/\/ same as animals.sort().reverse()<\/p>\n<p>[\/groovy]<\/p>\n<p style='padding-bottom:10px;'>\nUseful Links :<\/p>\n<p><a href=\"http:\/\/mvnrepository.com\/artifact\/commons-collections\/commons-collections\/3.2.1\">http:\/\/mvnrepository.com\/artifact\/commons-collections\/commons-collections\/3.2.1<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List&amp;lt;String&amp;gt; animals=[&amp;quot;Monkey&amp;quot;, null, &amp;quot;Ape&amp;quot;, null, &amp;quot;Tiger&amp;quot;, &amp;quot;Lion&amp;quot;] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":14,"footnotes":""},"categories":[1],"tags":[1054,68,1056,1055,1053],"class_list":["post-8507","post","type-post","status-publish","format-standard","hentry","category-technology","tag-commons-collections","tag-sort","tag-null-as-highest-value","tag-null-as-lowest-value","tag-nullcomparator"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[&quot;Monkey&quot;, null, &quot;Ape&quot;, null, &quot;Tiger&quot;, &quot;Lion&quot;] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Bhagwat Kumar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Sorting list with nulls as higher value | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[&quot;Monkey&quot;, null, &quot;Ape&quot;, null, &quot;Tiger&quot;, &quot;Lion&quot;] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Sorting list with nulls as higher value | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[&quot;Monkey&quot;, null, &quot;Ape&quot;, null, &quot;Tiger&quot;, &quot;Lion&quot;] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#article\",\"name\":\"Sorting list with nulls as higher value | TO THE NEW Blog\",\"headline\":\"Sorting list with nulls as higher value\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2012-09-25T01:32:42+05:30\",\"dateModified\":\"2022-01-13T16:47:56+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#webpage\"},\"articleSection\":\"Technology, commons-collections, Groovy Sort, null as highest value, null as lowest value, NullComparator\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#listItem\",\"name\":\"Sorting list with nulls as higher value\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#listItem\",\"position\":3,\"name\":\"Sorting list with nulls as higher value\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/\",\"name\":\"Bhagwat Kumar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d6c506f803fe26906ef802b1eaee463146e449a8b5b3d1f7e4ebc715b933d620?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Bhagwat Kumar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/\",\"name\":\"Sorting list with nulls as higher value | TO THE NEW Blog\",\"description\":\"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[\\\"Monkey\\\", null, \\\"Ape\\\", null, \\\"Tiger\\\", \\\"Lion\\\"] println animals.sort() \\\/\\\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \\\/\\\/ [Tiger, Monkey, Lion, Ape, null, null] [\\\/groovy] You can see\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/sorting-list-with-nulls-as-higher-value\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/bhagwat\\\/#author\"},\"datePublished\":\"2012-09-25T01:32:42+05:30\",\"dateModified\":\"2022-01-13T16:47:56+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Sorting list with nulls as higher value | TO THE NEW Blog","description":"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[\"Monkey\", null, \"Ape\", null, \"Tiger\", \"Lion\"] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see","canonical_url":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#article","name":"Sorting list with nulls as higher value | TO THE NEW Blog","headline":"Sorting list with nulls as higher value","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2012-09-25T01:32:42+05:30","dateModified":"2022-01-13T16:47:56+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#webpage"},"articleSection":"Technology, commons-collections, Groovy Sort, null as highest value, null as lowest value, NullComparator"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/www.tothenew.com\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#listItem","name":"Sorting list with nulls as higher value"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#listItem","position":3,"name":"Sorting list with nulls as higher value","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/","name":"Bhagwat Kumar","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d6c506f803fe26906ef802b1eaee463146e449a8b5b3d1f7e4ebc715b933d620?s=96&d=mm&r=g","width":96,"height":96,"caption":"Bhagwat Kumar"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/","name":"Sorting list with nulls as higher value | TO THE NEW Blog","description":"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[\"Monkey\", null, \"Ape\", null, \"Tiger\", \"Lion\"] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/bhagwat\/#author"},"datePublished":"2012-09-25T01:32:42+05:30","dateModified":"2022-01-13T16:47:56+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Sorting list with nulls as higher value | TO THE NEW Blog","og:description":"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[&quot;Monkey&quot;, null, &quot;Ape&quot;, null, &quot;Tiger&quot;, &quot;Lion&quot;] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see","og:url":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Sorting list with nulls as higher value | TO THE NEW Blog","twitter:description":"I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List animals=[&quot;Monkey&quot;, null, &quot;Ape&quot;, null, &quot;Tiger&quot;, &quot;Lion&quot;] println animals.sort() \/\/ [null, null, Ape, Lion, Monkey, Tiger] println animals.sort().reverse() \/\/ [Tiger, Monkey, Lion, Ape, null, null] [\/groovy] You can see","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"8507","title":null,"description":null,"keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":{"id":"#aioseo-article-65e03d55a9819","slug":"article","graphName":"Article","label":"Article","properties":{"type":"BlogPosting","name":"#post_title","headline":"#post_title","description":"#post_excerpt","image":"","keywords":"","author":{"name":"#author_name","url":"#author_url"},"dates":{"include":true,"datePublished":"","dateModified":""}}},"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2021-04-29 11:59:26","updated":"2024-02-29 08:16:21","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tSorting list with nulls as higher value\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Technology","link":"https:\/\/www.tothenew.com\/blog\/category\/technology\/"},{"label":"Sorting list with nulls as higher value","link":"https:\/\/www.tothenew.com\/blog\/sorting-list-with-nulls-as-higher-value\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/8507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=8507"}],"version-history":[{"count":1,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/8507\/revisions"}],"predecessor-version":[{"id":54655,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/8507\/revisions\/54655"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=8507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=8507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=8507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}