-
Notifications
You must be signed in to change notification settings - Fork 15
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
key value as mapper.idAttribute property #37
Comments
js-data-firebase works best when the key is part of the result set. If you use js-data-firebase to create records in firebase, then it will save the key to the result set for you. It looks like you may be loading items that were not created by js-data-firebase, and thus do not have the key in the result set. Your suggestion of adding Object.defineProperty(value, mapper.idAttribute, {
value: key
}) seems like it would work, I look forward to your PR. However, couldn't it be simplified to value[mapper.idAttribute] = key ? |
Hi Jason, my suggested code will look like this:
if you think it is fine and you agree Ill offer even to make the change and to begin as the js-data-firebase contributor, step by step :) Best, |
Mi Idea for creating a property on
Best, |
as return from
_find
and_findAll
we have result array of objects result ofdatasnapshot.val()
and key of the result is not part of the result set.I suggest that we create
mapper.idAttribute
property on the result set objects array._findAll
will look like this:this part is added.
Best,
Jovan
The text was updated successfully, but these errors were encountered: