-
Notifications
You must be signed in to change notification settings - Fork 83
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
Nested projections do not function correctly #25
Comments
So I did some research on this and it seems that the issue is
|
I can hand roll a nested retrieval get/set but I filed another issue about replacing Underscore with Lodash (maybe in a v0.7.0) which would solve this issue. |
You are right about the issue being For instance given the object var obj = { "name": "Steve", "age": 15, "features": { "hair": "brown", "eyes": "brown" } }; Currently: getValue(obj, "features.hair"); // undefined
resolve(obj, "features.hair"); // "brown" We desire the full object graph leading to the value so that. resolveObj(obj, "features.hair"); // {"features": {"hair": "brown"}} I have a working fix for this at the moment, but I still need to do some extra to also handle dropping nested keys which will also not be working correctly. Concerning lodash however I don't think we gain much switching. Even with their |
Fixed in v0.7.0 |
If you have a nested projection, it fails to match:
In MongoDB, this would return
[ { "_id" : ObjectId("57b86248bc6b3372ac511267"), "features" : { "hair" : "brown" } } ]
.The text was updated successfully, but these errors were encountered: