Skip to content
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

Avoid aliasing id & rev if prop names are already there #281

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ikr
Copy link

@ikr ikr commented Jan 20, 2015

Because of obscure historical reasons, we have an id property in our CouchDB documents. So, when one GET-s such a document with curl, they'll see something like:

{ _id: '811b77f35fca01bae6eb9b8ad67becc4',
  _rev: '1-c70b6027c1d75917cef89710a6ef02f0',
  id: '10001',
  name: 'Sorell Hotel Aarauerhof',
  ratingStars: 3,
  ...}

However, if we get() such a document with cradle, our id value disappears, becoming a non-enumerable property with a value of 811b77f.... That change helps avoiding such a situation.

Because of obscure historical reasons, we have an `id` property in our CouchDB
documents. So, when one GET-s such a document with `curl`, they'll see something
like:

{ _id: '811b77f35fca01bae6eb9b8ad67becc4',
  _rev: '1-c70b6027c1d75917cef89710a6ef02f0',
  id: '10001',
  name: 'Sorell Hotel Aarauerhof',
  ratingStars: 3,
  ...}

However, if we `get()` such a document with cradle, our `id` value disappears,
becoming a non-enumerable property with a value of `811b77f...`. That change
helps avoiding such a situation.
@xeodou
Copy link

xeodou commented Feb 16, 2015

We have same issue here. I don't want id replaced by cradle.

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

Successfully merging this pull request may close these issues.

2 participants