我想使用接收 BSON 数据的 runCommand() 运行原始 mongoDb 查询。以下是我的代码
MongoClient mongoClient = new MongoClient();
MongoDatabase database = mongoClient.getDatabase("MyDB");
MongoCollection<Document> collection = (MongoCollection<Document>)database.runCommand(??);如果我的查询是
db.mycol.find({"by":"教程点"})。
我必须在 runCommand() 中传递的 BSON 数据应该是什么?难道只有
{{"by":"教程点"}}
或者
db.mycol.find({"by":"教程点"})。
如果不是 find() 我必须使用 Insert() 怎么办?
海绵宝宝撒
UYOU
慕尼黑8549860
噜噜哒
随时随地看视频慕课网APP
相关分类