MongoDB implements afindOne()
collection operation.
However, looking into the collection operations available in the Mongo C driver I haven't found it there. It's a bit surprising, as other drivers implements it (such as the C++ driver).
Interestingly, I have found in the Mongo C driver code repository a kind of implementation for a findOne function. However it seems it is in a part of the code related with the tets...
Thus, is the Mongo C driver providing a findOne()
operation? Or do I need to implement it myself (maybe using mongoc_collection_find_with_opts setting limit to 1)?