These are chat archives for db-migrate/node-db-migrate

21st
Oct 2015
Eric Lin
@ericln
Oct 21 2015 21:19
just a quick question on mongodb migration. are we limited to the functionalities exposed via the nosql api?
Tobias Gurtzick
@wzrdtales
Oct 21 2015 22:41

@ericln Well the current implementation would only allow you to use methods from the driver only via _run looking down here in the default branch if this switch: https://github.com/db-migrate/mongodb/blob/master/index.js#L361

However, go ahead and open a proposal, given your use case, your ideas and why you think things may are done better another way. As long as things follow the path of beeing backwards compatible, stable and are reasonable, they can change. and I will be happy to hear the ideas of the community.

and working on making things better with you together. Not to forget it is also always possible to extend the current api.
Eric Lin
@ericln
Oct 21 2015 23:25
@wzrdtales i see, _run does expose methods from the mongodb native driver. Haven’t gotten a chance to look at the code in much detail yet, is there a way we can access the mongodb native driver?
@wzrdtales one of the reason is to ensure we have access to the aggregation framework provided by the native driver so we can write a a bit more complex migration logic in the scripts
Tobias Gurtzick
@wzrdtales
Oct 21 2015 23:45
@ericln, no not really. I have also asked Tom once why he has designed the driver like it is now and there wasn't a clear reason though, he mentioned that he think that there has been some problems with keeping the connections open, haven't had the time to further investigate on this yet. To explain why you can't:
_run does open a connection executes your command, gives you the result and then closes the connection. I wanted to rework this anyway, but did not have the time yet to do so, other drivers of db-migrate do keep the connection open for the whole migration process. However PRs are welcome if you would want to add functions to the API or maybe also rewrite the execution method _run of the mongodb driver to use an open connection. An option would be to have an api method ( on the mongodb driver only not for the global noSql api description though) that returns the driver a connection that it can use.
However my focus is currently clearly on the db-migrate framework in general and I can't guarantee to make big changes at this drivers as quick as I would want to.
Tobias Gurtzick
@wzrdtales
Oct 21 2015 23:52
@ericln Also to add, I would be grateful if you could just have writedown of your thoughts and usecases as this really important for me and the way how db-migrate evolves. If you do this, open them as issues, as chat is just for chatting :). Can you also tell me if you're going to do data manipulation or is it really just a migration?
I'm also going to open a RFC soon in which I also wanted to get a greater view of the needs that exists that I may not see yet.