Closed signalwerk closed 8 years ago
In this current state I can't merge this, first of all b/c this is not exposed as an api and also b/c of the following:
You should never use _
functions. Those are in all node projects considered to be private
. You have no guarantees that the behavior is not being broken in maybe already the next patch. Thus using this opens you to a serious risk, b/c of the missing guarantees. If you use an underscore prefixed function, be prepared that your software is already broken on the next update.
Unless you take this risk while knowing the risk itself, it is not recommended to use any private function.
Also please specify, your use case:
Is it
or is it
I'm absolutely aware of the meaning of Underscore-Functions. And because I don't wanna mess with any API I don't understand I added it to a private function. It solved my problem, it's a minor addition and it wont break any existing code since it's a private function. And for people who really wanna deal with fire and use private API we have at least an option. I have basically a similar problem as described here: https://github.com/db-migrate/node-db-migrate/issues/342 and I took the solution you suggested there. I would understand it as a data manipulation/transformation because of some changes in my data structure.
Ok, good, so you mean that as an addition to the internals of the mongodb driver.
From that perspective I'm fine with your additions and would just change the title to avoid anyone being confused this being an official function.
:blush: perfect thank you!
In mongodb I was able to do the following:
db.users.update( {}, { $rename: { 'permissions': 'accesses' } }, { upsert: false, multi: true } )
For the migration I had to add the
update
implementation to the mongo-handling. Now I can do: