I am developing a feature based on CountDocuments of Collection. But I just found this function can only be used after 4.0. Now our production server runs version 3.6, is there any other equivalent functions for 3.6? And BTW, is there any tools to help me check if the API I am using is available for specific version of mongodb. I am using golang.
The CountDocuments function will still work with server version 3.6. You can check on the driver docs to see if something is restricted to certain versions. If nothing is specified, it should work with all supported server versions. Also, the driver will return an error if something is not compatible with your current server version.