我正在使用Mongodb和java并尝试创建文档:
// mongo-java-driver-2.10.1 version
// create a document to store key and value
BasicDBObject document = new BasicDBObject();
document.put("name", "Yassine LD");
BasicDBObject documentDetail = new BasicDBObject();
documentDetail.put("addressLine1", "Sweet Home");
documentDetail.put("addressLine2", "New Street");
documentDetail.put("addressLine3", "CASABLANCA, MOROCCO");
document.put("address", documentDetail);
table.insert(document);
我收到此错误:DBCollection类型中的方法insert(DBObject [])不适用于参数(BasicDBObject)
答案 0 :(得分:1)
您的{ createAction, handleAction, handleActions } = require 'redux-actions'
方法似乎需要一个insert
数组。假设DBObject
是BasicDBObject
的子类,您可以写:
DBObject