Hello,
I was trying to list items in a MongoCursor in a template but the foreach do not works. If I print the cursor I can see two items and the same foreach works in the d app.
app.d
auto users = conn.getCollection("db.users").find();
res.render!("index.dt", users);
index.dt
p Users already known (#{users}):
- foreach (user; users)
p= user.name.get!string()
which print
Users already known ([{"_id":"530d014d4d9444875e000000","name":"Cif"}, {"_id":"530d01b24d9444875e000001","name":"Ciof"}]):
What am I doing wrong?
Thanks for help
Andrea