fons / cl-mongo

lisp interface to mongo db
fons.github.com/cl-mongo
MIT License
142 stars 31 forks source link

Incorrect cursor ids from mongo-reply #16

Closed pcostanza closed 11 years ago

pcostanza commented 11 years ago

Hi,

I am experimenting with cl-mongo, and had some problems with db.next not producing any results. I was able to track down the issue to the incorrect handling of cursor ids in the loop in mongo-reply (protocol.lisp line 140). Cursor ids are 64bit, but are treated here as 32 bit. When I comment out the loop, and uncomment the nreverse-version in line 144-153, everything works fine. (There should also normally not be any noticeable performance benefit from using the loop over the nreverse variant.)

On a related note, I believe it would be useful if db.iterator would be exported from the cl-mongo package.

fons commented 11 years ago

Followed your advice and uncommented the change. Also exported db.iterator. Thanks for pointing this out !