![]() ![]() Connect to a MongoDB DeploymentĬonnect to a MongoDB deployment and declare and define a MongoDatabase instance.įor example, include the following code to connect to a standalone MongoDB deployment running on localhost on port 27017: MongoClient mongoClient = MongoClients.create() įor additional information on connecting to MongoDB, see Connect to MongoDB. This guide uses the Subscriber implementations as covered in the Quick Start Primer. Include the following import statements: import .MongoClients That can be found with the driver source on github. The following code snippets come from the GridFSTour.java example code ![]() When you query a GridFS store for a file, the Java driver will reassemble the chunks as needed. Instead of storing a file in a single document, GridFS divides a file into parts, or chunks, and stores each of those chunks as a separate document. GridFS is a specification for storing and retrieving files that exceed the BSON document size limit of 16MB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |