简体   繁体   English

MongoDB Java异步驱动程序导入错误

[英]Import error with MongoDB Java async driver

I'm using the async MongoDB Java Driver version 3.4.2, and I am building the project with Gradle (to be specific, I'm building org.mongodb:mongodb-driver-async:3.4.0 ). 我正在使用异步MongoDB Java驱动程序版本3.4.2,并且正在使用Gradle构建项目(具体来说,我正在构建org.mongodb:mongodb-driver-async:3.4.0 )。 When I import the line: 当我导入该行时:

import com.mongodb.Block;

the import works just fine, but when I try to import: 导入工作正常,但是当我尝试导入时:

import com.mongodb.BasicDBObject;

I get an error: 我收到一个错误:

error: cannot find symbol
import com.mongodb.BasicDBObject;

What is the issue with my import here? 我在这里的导入有什么问题? In the most recent API documentation, MongoDB says that BasicDBObject is still located within the package com.mongodb 在最新的API文档中,MongoDB表示BasicDBObject仍位于包com.mongodb

driver and driver-async are two separate independent modules. driverdriver-async是两个独立的独立模块。

BasicDBObject is part of driver while Block is part of driver-async . BasicDBObjectdriver一部分,而Blockdriver-async一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM