使用JAVA向MongoDB中插入数据时报错The method insert(DBObject[]) in the type DBCollection is not applicable
来源:互联网 发布:cmd 关闭端口 编辑:程序博客网 时间:2024/06/05 03:47
MONGODB JAVA驱动API文档地址:
http://mongodb.github.io/mongo-java-driver/3.4/javadoc/
DBCollection users = db.getCollection("users");
BasicDBObject user1=new BasicDBObject("name","zj").append("sex","male").append("age","24").append("address",new BasicDBObject("street","chaoyangzhonglu").append("number", "666"));users.insert(user1);
报错The method insert(DBObject[]) in the type DBCollection is not applicable for the arguments (BasicDBObject)
方法:
1.修改JAVA project的java compiler 为1.5以上
2.users.insert(new DBObject[] {user1});
阅读全文
0 0
- 使用JAVA向MongoDB中插入数据时报错The method insert(DBObject[]) in the type DBCollection is not applicable
- The method setStatus(int) in the type Goods is not applicable for the arguments (Integer)
- The method setClass(Context, Class<?>) in the type Intent is not applicable for the arguments (GameV
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the,
- The method load(Class, Serializable) in the type Session is not applicable for the arguments (Class<
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argum
- The method addActionListener(ActionListener) in the type AbstractButton is not applicable for the ar
- The method setClass(Context, Class<?>) in the type Intent is not applicable for the问题
- The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argument
- The method setBackground(Drawable) in the type View is not applicable for the arguments (int)
- FileReader采用的默认编码 ?
- 【慕课网_性能优化之MySQL优化_学习】【03】
- 计数排序
- 实体序列化生成个性XML ,生成XML节点/属性
- ios app增加ituns文件共享功能
- 使用JAVA向MongoDB中插入数据时报错The method insert(DBObject[]) in the type DBCollection is not applicable
- 线程条件变量
- Mysql数据库主从配置
- 51Nod 1110 距离之和最小 V3(中位数+权值转化为个数)
- 【特征工程】特征选择与特征学习
- codeforces 546B Soldier and Badges
- 我对 js的深复制与浅复制 的理解
- 归并排序
- 2017中国企业互联网CEO峰会暨崔牛会年会即将震撼来袭!