Working functionally with third party libraries

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 16 13:15:10 PDT 2015


On Thursday, 16 July 2015 at 20:00:38 UTC, Ali Çehreli wrote:
> On 07/16/2015 12:35 PM, "Jarl 
> =?UTF-8?B?QW5kcsOpIEjDvGJlbnRoYWwi?= <jarl.andre at gmail.com>" 
> wrote:
>> Hi
>>
>> using mongo with vibe.d is easy. But I would like to skip the 
>> foreach on
>> MongoCursor?
>>
>> I mean, I want to use map!, filter! and reduce! on the 
>> resulting docs.
>> Is there a fast way to convert MongoCursor to an array without 
>> resolving
>> to ugly for loops with appender! ?
>
> I've never used MongoCursor but judging from the fact that it 
> has empty, front, and popFront(), it is an InputRange:
>
>   http://vibed.org/api/vibe.db.mongo.cursor/MongoCursor
>
> Have you tried using it with map and others? What errors do you 
> get?
>
> Ali

I wish I could delete this thread :) Problem was with lack of 
auto completion for map!, each! etc in Eclipse. Please ignore :) 
Hush foreach away you go :)


More information about the Digitalmars-d-learn mailing list