title: URL shortening for NoSQL databases?
body: <p>Writing a URL shortener seems fairly straightforward for a traditional database, with a couple notable exceptions:</p>
  
  <pre><code>def save_new_url(request):
      url = StoredUrl(url=request.POST['url'])
      url.save()
  
      url.short_link = base62(url.id)
      url.save()
  
      return direct_to_template('mytemplate.html', { 'link': url.short_link })
  </code></pre>
  
  <p>The only problem with the above example is the lack of support for known exceptions, URLs which should be reserved for system/site usage, like <code>account</code> or <code>admin</code>. </p>
  
  <p>How then, can I make a URL shortening service for a NoSQL database like MongoDB, which uses hexadecimal values as keys for its 'rows'? It seems that most URL shorteners work on shortening numbers into <code>[a-zA-Z0-9]</code> sets of characters. Since I don't have a number to work with, how can I shorten a URL stored in a MongoDB table?</p>