java.lang.IllegalArgumentException

BasicBSONList can only work with numeric keys, not: [_id][info]


Samebug tips1

This happened when I tried to insert an empty list of elements to a MongoDB collection.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web16728

Solution icon of googlegroups
BasicBSONList can only work with numeric keys, not: [_id][info]

Solution icon of googlegroups
via Google Groups by Robbie Cheng, 1 year ago
BasicBSONList can only work with numeric keys, not: [_id]

Solution icon of stackoverflow
BasicBSONList can only work with numeric keys, not: [_id]

Solution icon of stackoverflow
BasicBSONList can only work with numeric keys, not: [_id]

Solution icon of stackoverflow
via Stack Overflow by Mike Dynamite
, 1 year ago
BasicBSONList can only work with numeric keys, not: [_id]

Solution icon of stackoverflow
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]

Solution icon of googlegroups
via Google Groups by Robbie Cheng, 1 year ago
BasicBSONList can only work with numeric keys, not: [_id]

Solution icon of stackoverflow
BasicBSONList can only work with numeric keys, not: [_id]

Solution icon of googlegroups
BasicBSONList can only work with numeric keys, not: [className]

Solution icon of googlegroups
BasicBSONList can only work with numeric keys, not: [LIST]

Stack trace

  • 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)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
2 times, 1 week ago
Once, 2 months ago
Once, 2 months ago
2 times, 4 months ago
5 more bugmates