I want to write an abbreviation URL as a standalone CouchApp, but I am wondering if this is possible. Obviously, the basic requirement for shortening URLs is to have short and unique keys.
I want to post the long url of CouchDB and get the shortened url. I was thinking about using an update handler, but it would have to query the DB to check if the key is unique, which seems impossible.
Is there a way to generate short and unique keys with CouchDB? Or do I need a thin wrapper around CouchDB?
I would go for thin packaging based on documents with the following structure:
{ _id : short_url , url : long_url }
URL- : _id, PUT _id, . , URL- .
_id
, ", , " - , .
, URL URL-, echo(doc.url,null) _id URL-, . , , URL- , URL- URL-.
echo(doc.url,null)
Source: https://habr.com/ru/post/1778940/More articles:How do I publish a Facebook feed as someone other than a registered user? - facebookProblem with TortoiseSVN Global Ignore template for Visual Studio project - version-controlcreating a table using glui - openglCustom Collections in Doctrine 1.2 - phpdisplaying results from oracle 10g stored procedure - oracleusing count in a subquery and getting errors - sqlmaven assembly: single assembly with errors: assembly descriptors not found - mavenWPF data template width - wpfSimple simulation of multiple dialogs - jqueryConstructor Chain with Intermediate Variables - constructorAll Articles