-
Notifications
You must be signed in to change notification settings - Fork 19
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
set() does not create a nested structure #10
Comments
@olastor Yeah, it looks like a bug because mpath is an implementation of a MongoDB-like path notation and MongoDB works as you expect. |
What is the actual behavior if you do a mpath.set('a.3.3', 3, obj); I mean it could be |
@Uzlopak I think mpath should err on the side of consistency with the MongoDB server. So the first one you listed is the "correct" behavior.
But anyway, I ran into this limitation recently with Mongoose as well. I'll open an issue to track this in Mongoose |
@vkarpov15 |
Perhaps this is expected behaviour, but I do not understand why this does not work:
It returns an empty object
{}
, while I was expecting it to return{ a: { b: 3 } }
. Using.get()
it works the other way around:The text was updated successfully, but these errors were encountered: