Permalink
Browse files

[fix] stdlib: Fixed cursor valid predicate yet again.

  • Loading branch information...
1 parent 7a183dc commit 4d612ef2cc5e68b92224ce8531907831fa2fb0e6 @nrs135 nrs135 committed Dec 19, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 stdlib/apis/mongo/cursor.opa
View
3 stdlib/apis/mongo/cursor.opa
@@ -293,7 +293,8 @@ MongoCursor = {{
valid(c:Mongo.cursor): bool =
not(c.killed)
&& ((not(c.query_sent) && Option.is_some(c.query)) // initialised but not run
- || ((c.returned > 0 && (c.current < c.returned)))) // run and still has data
+ || ((c.returned > 0 && (c.current < c.returned))) // run and still has data
+ || not(MongoCommon.is_null_cursorID(c.cid))) // non-zero cursor, more data on server
/**
* Full [find] function with all parameters.

0 comments on commit 4d612ef

Please sign in to comment.