com.mongodb.gridfs.GridFS.getFilesCollection()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中com.mongodb.gridfs.GridFS.getFilesCollection()方法的一些代码示例,展示了GridFS.getFilesCollection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridFS.getFilesCollection()方法的具体详情如下:
包路径:com.mongodb.gridfs.GridFS
类名称:GridFS
方法名:getFilesCollection

GridFS.getFilesCollection介绍

[英]Gets the DBCollection in which the file's metadata is stored.
[中]获取存储文件元数据的DBCollection。

代码示例

代码示例来源:origin: org.mongodb/mongo-java-driver

  1. /**
  2. * Removes file from GridFS i.e. removes documents from files and chunks collections.
  3. */
  4. void remove() {
  5. fs.getFilesCollection().remove(new BasicDBObject("_id", id));
  6. fs.getChunksCollection().remove(new BasicDBObject("files_id", id));
  7. }

代码示例来源:origin: org.mongodb/mongo-java-driver

  1. /**
  2. * Saves the file entry to the files collection
  3. *
  4. * @throws MongoException if there's a failure
  5. */
  6. public void save() {
  7. if (fs == null) {
  8. throw new MongoException("need fs");
  9. }
  10. fs.getFilesCollection().save(this);
  11. }

代码示例来源:origin: org.mongodb/mongodb-driver

  1. /**
  2. * Saves the file entry to the files collection
  3. *
  4. * @throws MongoException if there's a failure
  5. */
  6. public void save() {
  7. if (fs == null) {
  8. throw new MongoException("need fs");
  9. }
  10. fs.getFilesCollection().save(this);
  11. }

代码示例来源:origin: org.mongodb/mongodb-driver

  1. /**
  2. * Removes file from GridFS i.e. removes documents from files and chunks collections.
  3. */
  4. void remove() {
  5. fs.getFilesCollection().remove(new BasicDBObject("_id", id));
  6. fs.getChunksCollection().remove(new BasicDBObject("files_id", id));
  7. }

相关文章