Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ledger.prototype.find_all = function(callback) {
- this.collection(function(err, collection) {
- collection.find(function(err, cursor) {
- cursor.toArray(function(err, docs) {
- callback.apply(this,[err,docs]);
- });
- });
- });
- };
- # Same problems with this write of it
- #
- Ledger.prototype.find_all = function(callback) {
- this.collection(function(err, collection, client) {
- raise_if(err);
- collection.find(function(err, cursor) {
- raise_if(err);
- docs = []
- cursor.each(function(err, doc) {
- raise_if(err);
- docs[docs.length] = doc
- });
- callback.apply(this,[err,docs]);
- client.close();
- });
- });
- };
Add Comment
Please, Sign In to add comment