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

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

本文整理了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

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

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

/**
 * Saves the file entry to the files collection
 *
 * @throws MongoException if there's a failure
 */
public void save() {
  if (fs == null) {
    throw new MongoException("need fs");
  }
  fs.getFilesCollection().save(this);
}

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

/**
 * Saves the file entry to the files collection
 *
 * @throws MongoException if there's a failure
 */
public void save() {
  if (fs == null) {
    throw new MongoException("need fs");
  }
  fs.getFilesCollection().save(this);
}

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

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

相关文章