New to Node, Mongoose & Mongodb - haven\'t read the source code...
I have a Node application which opens a file, parses the lines into records and saves the reco
You do need to call mongoose.disconnect() to close the connection, but you also need to wait until all save calls have completed their async work (i.e. called their callback) before doing that.
So either keep a simple count of how many are still outstanding to keep track or use a flow control framework like async to do something a bit more elegant.