@Autowired
MongoDatabase database;
@Override
public List<Grid> getAdditionalGrid(String collection, int cityDataId) {
MongoCollection<Document> gridColl = database.getCollection("grid");
FindIterable<Document> grids = gridColl.find(Filters.eq("cityDataId", cityDataId))
.projection(new BasicDBObject().append("grid_id", true).append("_id",true));
}
}
转载于:https://www.cnblogs.com/CHWLearningNotes/p/9151727.html