java.lang.IllegalArgumentException

Update document keys must start with $: _id


Samebug tips1

Use replaceOne instead of updateOne

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


Solutions on the web8260

Solution icon of stackoverflow
via Stack Overflow by Unknown author, 1 year ago
Update document keys must start with $: _id

Solution icon of googlegroups
via Google Groups by Vivek YS, 7 months ago
Update document keys must start with $: _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 googlegroups
BasicBSONList can only work with numeric keys, not: [_id][info]

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 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
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]

Stack trace

  • java.lang.IllegalArgumentException: Update document keys must start with $: _id at com.mongodb.DBCollectionImpl$Run.executeUpdates(DBCollectionImpl.java:769) at com.mongodb.DBCollectionImpl$Run.execute(DBCollectionImpl.java:734) at com.mongodb.DBCollectionImpl.executeBulkWriteOperation(DBCollectionImpl.java:149) at com.mongodb.DBCollection.executeBulkWriteOperation(DBCollection.java:1737) at com.mongodb.DBCollection.executeBulkWriteOperation(DBCollection.java:1733) at com.mongodb.BulkWriteOperation.execute(BulkWriteOperation.java:93) at com.mongodb.casbah.BulkWriteOperation$$anonfun$1.apply(BulkWriteOperation.scala:71) at com.mongodb.casbah.BulkWriteOperation$$anonfun$1.apply(BulkWriteOperation.scala:71) at scala.util.Try$.apply(Try.scala:161) at com.mongodb.casbah.BulkWriteOperation.execute(BulkWriteOperation.scala:71)

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

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.