I am trying to connect to MongoDB via the c++ driver. If I provide the IP based URI everything works fine, however when I try to use a unix domain socket URI I get the following error:
an invalid MongoDB URI was provided
I am trying to connect in the following way:
mongocxx::uri uri{"mongodb:///tmp/mongodb-27017.sock"};
mongocxx::pool *p = new mongocxx::pool (uri);
If I replace the uri string with mongodb://localhost:27017/?minPoolSize=0&maxPoolSize=10
, it works just fine.
I am probably doing something wrong, not sure what though.