vibe.d mongo updateOne error

2023-04-21 Thread Ben Jones via Digitalmars-d-learn
I'm trying to update an app from an older version of Vibe.d to a newer version that supports modern Mongo (0.9.7-alpha2) I'm replacing an older call to collection.update() to collection.updateOne() instead. I had to change the options parameter to an updated struct, and it now compiles, but I

Re: Getting a total from a user defined variable

2023-04-21 Thread Salih Dincer via Digitalmars-d-learn
On Friday, 21 April 2023 at 05:23:14 UTC, Joel wrote: Or: p.map!"a.age".sum; works too. If it was me I would use each(). But D is such a powerful language that you have many alternatives: ```d import std.algorithm, std.range, std.stdio; struct Person { string name; int age; } auto totalPe