marcello3d / node-mongolian

[project inactive] Mongolian DeadBeef is an awesome Mongo DB driver for node.js
https://groups.google.com/group/node-mongolian
zlib License
349 stars 50 forks source link

Error when using skip and limit #73

Closed shebbys closed 12 years ago

shebbys commented 12 years ago

I'm consistently getting this error when querying a dataset of count 281 with the code:

The user can skip 10 or 25. skip(50) works fine. skip(60) and skip(70) gives error. skip(80) works.

Any ideas on what I can do here?

db.videos.find().limit(10).skip(60).toArray(function(e,d){

....

/Users/scott/Desktop/Project/node_modules/mongolian/node_modules/mongodb/lib/mongodb/connection/connection.js:161

   self.emit("parseError", {err:"socketHandler", trace:err, bin:buffer, pa

                                                       ^

ReferenceError: buffer is not defined at Socket. (/Users/scott/Desktop/Project/node_modules/mongolian/node_modules/mongodb/lib/mongodb/connection/connection.js:161:74) at Socket.emit (events.js:67:17) at TCP.onread (net.js:329:14)

6 Jan 12:36:46 - [nodemon] app crashed - waiting for file change before starting...

shebbys commented 12 years ago

One more thing: this only occurs from within express app.js. When I run the query outside of express there are no problems.

marcello3d commented 12 years ago

I'm not positive without doing more testing, but try updating to the latest mongolian and see if you still have the problem.

The version you're using still depends on mongodb-native and has a tendency to hide exceptions thrown in your callbacks.

marcello3d commented 12 years ago

Try out the 0.1.16 release and let me know if you still have a problem.