Mongo newbie here ๐๐ป Is it possible to do findOne after the populate?
The query string I have available belongs to the referenced document. I would like to first populate it and then find the document I am looking for.
Other wise I first need to do a findOne in one collection and pass the result to another collectionโs findOne.
I am trying to avoid an unnecessary findOne operation but maybe I am overthinking it and its okay to do multiple findOneโs to reach a result?
Another solution comes to my mind is to make the query string I have available an indexed unique field so I can directly do findOne.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Mongo newbie here ๐๐ป
Is it possible to do findOne after the populate?
The query string I have available belongs to the referenced document. I would like to first populate it and then find the document I am looking for.
Other wise I first need to do a findOne in one collection and pass the result to another collectionโs findOne.
I am trying to avoid an unnecessary findOne operation but maybe I am overthinking it and its okay to do multiple findOneโs to reach a result?
Another solution comes to my mind is to make the query string I have available an indexed unique field so I can directly do findOne.