I have this code:
const project = await Project.findOne({"code":currentUser.groupcode}); // this works