When doing a findOne query, the projection is being sent. With a find query it works perfectly.
Hi there @franciscosucrecobee
Happy to help you out with your query here. May you clarify what's not working? In your example I'm seeing a valid response.
Hi @Pawan look at the response, it is not using the projection I set. I should only find the id, name and logo parameters.
May you try the following instead:
{_id: 0, id: 1, name: 1, logo: 1, benefit: 0}
I think we need to clarify to not include that field explicitly.
Hi @Pawan,
It is the same result Also in my query, I was setting _id: 0 explicitly and it simply does not comply. It works fine with the find command, it is only on the findOne that does not work.
It does work on a mongo shell.
Hi there @franciscosucrecobee
Really sorry I wasn't able to catch this earlier but this is bug we're aware of internally with the findOne query not passing projection values.
Unfortunately I don't have a timeline as to when this will be taken care of but surely is in the works. I went on ahead and linked our conversation here alongside the ticket and will keep you updated with the progress we make towards resolution. I appreciate your patience in the meantime
thanks @Pawan, for now i will use a find command with limit 1 as a workaround. If there is any update please let me know. Thanks!