File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
source/includes/usage-examples/code-snippets Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 66import org .bson .BsonInt64 ;
77import org .bson .Document ;
88
9- import com .mongodb .ConnectionString ;
10- import com .mongodb .MongoClientSettings ;
119import com .mongodb .MongoException ;
1210import com .mongodb .client .MongoClient ;
1311import com .mongodb .client .MongoClients ;
1412import com .mongodb .client .MongoDatabase ;
13+ import org .bson .conversions .Bson ;
1514
1615
1716public class RunCommand {
@@ -28,14 +27,14 @@ public static void main(String[] args) {
2827
2928 // Retrieves statistics about the specified database
3029 Document commandResult = database .runCommand (command );
31-
30+
3231 // Prints the database statistics
3332 System .out .println ("dbStats: " + commandResult .toJson ());
34-
35- // Prints a message if any exceptions occur during the command execution
33+
3634 } catch (MongoException me ) {
35+ // Prints a message if any exceptions occur during the command execution
3736 System .err .println ("An error occurred: " + me );
3837 }
3938 }
4039 }
41- }
40+ }
You can’t perform that action at this time.
0 commit comments