Skip to content

Commit ed9f410

Browse files
author
Chris Cho
committed
DOCSP-34069: fix imports for run command usage example (#482)
* DOCSP-34069: fix imports for run command usage example (cherry picked from commit 3b23db4)
1 parent 61cf90f commit ed9f410

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

source/includes/usage-examples/code-snippets/Command.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
import org.bson.BsonInt64;
77
import org.bson.Document;
88

9-
import com.mongodb.ConnectionString;
10-
import com.mongodb.MongoClientSettings;
119
import com.mongodb.MongoException;
1210
import com.mongodb.client.MongoClient;
1311
import com.mongodb.client.MongoClients;
1412
import com.mongodb.client.MongoDatabase;
13+
import org.bson.conversions.Bson;
1514

1615

1716
public 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+
}

0 commit comments

Comments
 (0)