java.lang.IllegalArgumentException: Update


Samebug tips1

Use replaceOne instead of updateOne


8 months ago

Solutions on the web3

Solution icon of googlegroups
via Google Groups by miki haiat, 9 months ago
Update

Solution icon of googlegroups
via Google Groups by Vivek YS, 9 months ago
Update document keys must start with $: _id

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

Stack trace

java.lang.IllegalArgumentException: Update
	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

4 times, 2 weeks ago