Revision 47253
Added by Claudio Atzori almost 7 years ago
DnetLoggerMongoDao.java | ||
---|---|---|
55 | 55 |
@Override |
56 | 56 |
public void writeLog(final String collection, final Map<String, Object> map) { |
57 | 57 |
final MongoCollection coll = db.getCollection(collection); |
58 |
DBObject obj = BasicDBObjectBuilder.start(replaceKeyNames(map)).get();
|
|
59 |
coll.insertOne(obj);
|
|
58 |
final Document doc = new Document(replaceKeyNames(map));
|
|
59 |
coll.insertOne(doc);
|
|
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
private Map<String, Object> replaceKeyNames(final Map<String, Object> inputMap) { |
Also available in: Unified diff
save org.bson.Document instead of com.mongodb.DBObject