I am new to mongo and I am hoping you can help me with a novice question
I am trying to achieve this functionality in one query by fetching for something arbitrary like an id:
If no found results, then insert, else just return found results
Is this possible for insert-batch as well? Where if no found results for one of the inserting array elements, then insert, else return that element along with the others in the array.
Everywhere I have looked so far recommend either upsert (which achieves something different) or findAndModify (which I am not sure is overkill or not) MongoDB atomic "findOrCreate": findOne, insert if nonexistent, but do not update
I am very grateful for help you can offer.
All the best,
Ben