Permalink
Browse files

Merge pull request #2 from srijs/fix-pending

Update Dependencies and Fix Pending Request Handling
  • Loading branch information...
2 parents e5cde67 + b1dc662 commit 8f34ac8579921be790491a934343a0f3a6d7f795 @jiem committed Apr 7, 2013
Showing with 11 additions and 8 deletions.
  1. +6 −3 index.js
  2. +5 −5 package.json
View
@@ -40,8 +40,11 @@ exports.open = function(a, b, c) {
collectionWrapper.connection = collection;
pendingRequests = collectionWrapper.pendingRequests;
COLLECTION[collection.collectionName] = collection;
- for (i = 0; request = pendingRequests[i]; i++)
- collection[request.method].apply(collection, request.arguments);
+ if (pendingRequests) {
+ pendingRequests.forEach(function (request) {
+ collection[request.method].apply(collection, request.arguments);
+ });
+ }
}
}
@@ -150,4 +153,4 @@ mongo.Collection.prototype.findAll = function() {
}
//==============================================================================
-init();
+init();
View
@@ -1,15 +1,15 @@
{
"name": "mongo-lazy",
"description": "Node-mongodb-native for lazy people. Don't ever open a collection again. Eat a piece of cake while doing parallel queries.",
- "version": "0.0.2",
+ "version": "0.0.3",
"author": "Jie Meng-Gerard <contact@jie.fr>",
"repository": "git://github.com/jiem/mongo-lazy",
"keywords": ["mongo", "mongodb", "mongodb-native", "db"],
- "main": "./index.js",
+ "main": "index.js",
"engines": {
- "node": ">=0.7.0"
+ "node": "~0.10.0"
},
"dependencies": {
- "mongodb": "1.0.x"
+ "mongodb": "~1.2.0"
}
-}
+}

0 comments on commit 8f34ac8

Please sign in to comment.