You can use mongodump
or mongoexport
in order to create dumps of mongodb.
mongodump
is better for backing up and stores not just data, but a lot of meta data about the collections, like indexes. As well you can call it to specific database (-d) as well as collection (-c).
To do it from node.js, use child_process
.