Package io.quarkus.mongodb
Annotation Interface MongoClientName
@Target({TYPE,METHOD,FIELD,PARAMETER})
@Retention(RUNTIME)
@Documented
@Qualifier
public @interface MongoClientName
Marker annotation to select mongo connection of cluster configuration
Use name parameter to select it
For example, if a mongo connection is configured like so in
application.properties
:
quarkus.mongodb.cluster1.connection-string=mongodb://localhost:27018Then to inject the proper
MongoClient
, you would need to use MongoClientName
like so:
@Inject @MongoClientName("cluster1") MongoClient client;
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueSpecify the cluster name of the connection.- Returns:
- the value
- Default:
- ""
-