List of usage examples for com.mongodb.gridfs GridFSFile setMetaData
public void setMetaData(final DBObject metadata)
From source file:org.elasticsearch.river.mongodb.util.MongoDBHelper.java
License:Apache License
public static DBObject applyFieldFilter(DBObject object, final Set<String> includeFields, final Set<String> excludeFields) { if (object instanceof GridFSFile) { GridFSFile file = (GridFSFile) object; DBObject metadata = file.getMetaData(); if (metadata != null) { file.setMetaData(applyFieldFilter(metadata, includeFields, excludeFields)); }//from w w w . ja v a 2s .c om } else { object = MongoDBHelper.applyExcludeFields(object, excludeFields); object = MongoDBHelper.applyIncludeFields(object, includeFields); } return object; }