rwynn / monstache-site

documentation for the monstache project
https://rwynn.github.io/monstache-site/
MIT License
22 stars 31 forks source link

findOne cannot select field #9

Closed sfrenot closed 5 years ago

sfrenot commented 6 years ago

I think that we can select fields with find query, but not with findOne query.

     niveaucompetence.ue = find({"ecs":niveaucompetence.ec._id}, {
       database: "competences",
       collection: "ues",
       select: {
        "nom": 1,
       }
     });

works, but

     niveaucompetence.ue = findOne({"ecs":niveaucompetence.ec._id}, {
       database: "competences",
       collection: "ues",
       select: {
        "nom": 1,
       }
     });

isn't.

I also have a problem with select{"_id": } that I presume is not working.

sfrenot commented 6 years ago

Wrong project... Sorry

rwynn commented 6 years ago

Thanks I think I see the problem where the projection is not being applied to findOne. I’ll get a fix out for this soon.