RejectedSoftware Forums

Sign up

MongoCursor

I tried to implement MongoCursor.sort methods. But the current driver implementation doesn't allow to do this, because cursor iteration starts in MongoCollection.find method BEFORE actual creation of cursor and there is no possibility to add $orderby field to query.
I propose to start the iteration directly in the MongoCursor object in the first call MongoCursorData.popFront.
If vibe.d developers will agree, I can try to implement this proposal.

Re: MongoCursor

Am 20.10.2013 19:33, schrieb Jack Applegame:

I tried to implement MongoCursor.sort methods. But the current driver implementation doesn't allow to do this, because cursor iteration starts in MongoCollection.find method BEFORE actual creation of cursor and there is no possibility to add $orderby field to query.
I propose to start the iteration directly in the MongoCursor object in the first call MongoCursorData.popFront.
If vibe.d developers will agree, I can try to implement this proposal.

While this will have the slightly unfortunate effect of deferring any
exceptions that may occur, this seems to be only logical way to keep the
original API style. I think it's good and it would be great if you'd
try to implement it.

Re: MongoCursor

AFAIK, all MongoDB drivers behave that way.

Re: MongoCursor

https://github.com/rejectedsoftware/vibe.d/pull/353