Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update document - MongoServerError: Performing an update on the path '_id' would modify the immutable field '_id' #1360

Open
anowak-ct opened this issue Dec 10, 2023 · 2 comments

Comments

@anowak-ct
Copy link

anowak-ct commented Dec 10, 2023

When I try to update (i.e. changing any field apart from _id) a document, I am getting the following error:

mongodb-express  | MongoServerError: Performing an update on the path '_id' would modify the immutable field '_id'
mongodb-express  |     at /node_modules/mongodb/lib/operations/update.js:72:33
mongodb-express  |     at /node_modules/mongodb/lib/cmap/connection_pool.js:333:25
mongodb-express  |     at /node_modules/mongodb/lib/sdam/server.js:210:17
mongodb-express  |     at handleOperationResult (/node_modules/mongodb/lib/sdam/server.js:326:20)
mongodb-express  |     at Connection.onMessage (/node_modules/mongodb/lib/cmap/connection.js:243:9)
mongodb-express  |     at MessageStream.<anonymous> (/node_modules/mongodb/lib/cmap/connection.js:61:60)
mongodb-express  |     at MessageStream.emit (node:events:517:28)
mongodb-express  |     at processIncomingData (/node_modules/mongodb/lib/cmap/message_stream.js:125:16)
mongodb-express  |     at MessageStream._write (/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
mongodb-express  |     at writeOrBuffer (node:internal/streams/writable:392:12) {
mongodb-express  |   index: 0,
mongodb-express  |   code: 66,
mongodb-express  |   [Symbol(errorLabels)]: Set(0) {}
mongodb-express  | }

The _id property is the object id and is in our case of type Long

monogo-express version: 1.0.0-18 running in docker container.

Updating/Creating documents used work with earlier mongo-express versions. I worked with 1.0.0-alpha.4

@anowak-ct
Copy link
Author

Same error with 1.0.2-20-alpine3.19
Any help would be great.

@anowak-ct
Copy link
Author

Any noticed this ....? Any updates ....? Anyone ... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant