I can successfully insert and retrieve data from MongoDB s GridFS in Java. However, when I try to access that data on the command line using mongofiles, I can t find it. The Java insertion code:
GridFS fs = new GridFS(Mongo.getStaticMongo("localhost:27017").getDB("myDb"), "myCollection");
try {
GridFSInputFile inputFile = fs.createFile(content.getFile());
inputFile.put(MONGO_KEY, content.getId().toString());
inputFile.save();
} catch (IOException e) {
throw new RuntimeException(e);
}
指挥线:
>mongofiles --host localhost:27017 -d myDb -c myCollection -vvvvvv list
Tue Nov 09 11:48:01 creating new connection to:localhost:27017
connected to: localhost:27017
>
Java GridFS的司机在什么地方拿到这些档案?