Skip to content

Use colon as _id property separator #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tlvince opened this issue May 17, 2015 · 4 comments
Open

Use colon as _id property separator #13

tlvince opened this issue May 17, 2015 · 4 comments

Comments

@tlvince
Copy link

tlvince commented May 17, 2015

Per jo/couchdb-best-practices#39. Perhaps even make it configurable?

@jo
Copy link
Owner

jo commented May 18, 2015

Since : was used for named params before, this change requires a bigger effort and may introduce breaking changes.

I would suggest that we use Template Strings for named params.

I think this change would make docuri less intuitive, since it breaks the router analogy. But the project can also yield when this is taken as an incentive to rethink the api.

@jo jo mentioned this issue Jun 1, 2015
@denis-sokolov
Copy link
Contributor

It seems the problems with / are realistic enough to do something about it.
But the user experience of describing routes as URL routes is very important.
Among other things, it intuitively suggests a good design for routes, mirroring REST practices.

Here's a suggestions: perhaps we do not need to actually have the API and the implementation to match. After all, if one uses docuri properly, the use of slashes is a purely internal detail.
Consider the API that uses slashes: docuri.route('/items/:id'), but actually produces :items:23 when asked to build a path.
This is a controversial idea, let me know what you think.

@jo
Copy link
Owner

jo commented Jun 3, 2015

I like it!

@tlvince
Copy link
Author

tlvince commented Jun 3, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants