christkv/node-mongodb-native — Issue #441: How to know when application has ended
Author: jmzrlz
Created: 2011-12-14 20:18:08+00:00
State: open

This isn't really a bug, rather a question.

If I understood correctly, mongodb-native requires that you close the connection for the application to "end".
This is usually simple enough to do and causes no issues.

However, in my latest app, I need to retrieve a set of entries from the database and do some sort of processing on each one.
In such a situation, how am I supposed to know when all callbacks have been called in order to close the connection?

Requiring that the connection be closed really does cause logic issues. Since it is all asynchronous there isn't really an "end point" so how do I know where to close it?