Is there a simple method to extract the site name from a URL string?
For example:
http://www.mysite.com/mypath/mypage -> www.mysite.com
http://mysite.com/mypath/mypage -> mysite.com
The JavaScript code runs on the mongodb CLI side, not within a browser.