Hello @Fan_Rex,
Welcome to the MongoDB Community.
The error message “bsoncxx::document is ambiguous” typically occurs in the compiler when there is a naming conflict in the code. In this case, it appears that there may be a conflict between different definitions or declarations of the bsoncxx::document type.
I recommend checking for namespace conflicts in your code.
Here are a couple of links to similar discussions that might be helpful for you:
- compiler errors - reference to function is ambiguous in c++ - Stack Overflow
- Dealing with ambiguous declarations in C++ - Stack Overflow
Best,
Kushagra