我想知道如何将情感分析的 JSON 输出存储到 mongoDB 数据库。问题是情感 JSON 输出是一个 DocumentSentiment,而 monogoDB 输入必须是一个 Document 参数。这就是我所拥有的:
MongoCollection<Document> col2 = database.getCollection("test3");
col2.insertOne(sentiment);
一定有人在用 Java 玩 Alchemy 和 mongoDB 时经历过这种情况。