After another SO poster (Vinicius Miana) resolved my problem , insert List[DBObject]...
// Bulk insert all documents
collection.insert(MongoDBList(docs)) // docs is List[DBObject]
Now I see this error when trying to insert.
java.lang.IllegalArgumentException: BasicBSONList can only work with numeric keys, not: [_id]
EDIT
Full stack trace
[info] java.lang.IllegalArgumentException: BasicBSONList can only work with numeric keys, not: [_id]
[info] at org.bson.types.BasicBSONList._getInt(BasicBSONList.java:161)
[info] at org.bson.types.BasicBSONList._getInt(BasicBSONList.java:152)
[info] at org.bson.types.BasicBSONList.get(BasicBSONList.java:104)
[info] at com.mongodb.DBCollection.apply(DBCollection.java:767)
[info] at com.mongodb.DBCollection.apply(DBCollection.java:756)
[info] at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:220)
[info] at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204)
[info] at com.mongodb.DBCollection.insert(DBCollection.java:76)
[info] at com.mongodb.casbah.MongoCollectionBase$class.insert(MongoCollection.scala:508)
[info] at com.mongodb.casbah.MongoCollection.insert(MongoCollection.scala:866)
I checked the post with my same problem, but I'm not sure how to apply the accepted answer.
Does this error mean that I cannot insert key-value pairs in such a way that it is valuenot hidden before Int(behind BasicBSONList )?
source
share