Java MongoCollection中的搜索查询

Java MongoCollection中的搜索查询,java,mongodb,spring-boot,Java,Mongodb,Spring Boot,我的问题是-我想在中执行搜索操作 MongoCollection<Document> mongoCollection = database.getCollection(collectionName); Iterable<Document> fields = mongoCollection.find(); MongoCollection MongoCollection=database.getCollection(collectionName); Iterable fie

我的问题是-我想在中执行搜索操作

MongoCollection<Document> mongoCollection = database.getCollection(collectionName);
Iterable<Document> fields = mongoCollection.find();
MongoCollection MongoCollection=database.getCollection(collectionName);
Iterable fields=mongoCollection.find();
我想要字符串为“hello”的字段


我正在寻找具有字符串“hello”

的字段需要作者编辑什么类型的编辑?您查看了mongo文档吗?是的,我没有找到相关内容,我只想通过java代码获取具有特定单词的集合字段。text(字符串搜索)