mongodb-js / compass

The GUI for MongoDB.
https://mongodb.com/compass
Other
1.15k stars 176 forks source link

Cannot update document's field in sharded collection #1962

Closed kabamccortesdelafuente closed 3 years ago

kabamccortesdelafuente commented 4 years ago

Feature Request

Allow MongoDB Compass to update a document's field when the collection has a sharded key. Currently, you have to use the MongoDB shell or client driver.

Detailed Description

Include the sharded index key/value when you're trying to update the document

Context

We'll one of the selling points for me when it comes to GUIs like this is the ability to manipulate the data as I please. This issue is preventing me to do it.

Possible Implementation

My approach would be to use the indexInformation method to get the sharded index data and include it in the DB update command. In this post, you can see the current shell implementation example. https://stackoverflow.com/questions/60164435/mongodb-update-field-of-sharded-collection-using-compass

Anemy commented 4 years ago

Hello! Thanks for reporting this. Tracking this in our feedback forum also which allows for upvotes: https://feedback.mongodb.com/forums/924283-compass/suggestions/38675587-update-on-shard-cluster Hopefully we can get to this in soon for you, we've done a bit of work around improving updating documents recently, but this one hasn't quite made it in yet.

kabamccortesdelafuente commented 4 years ago

Thanks! I've upvoted it. Should we close this then?

Anemy commented 4 years ago

We can keep it open if that's alright. That way if anyone else has this issue they can see it's open - and we can also then remember to close this issue and here when this functionality is added.

Anemy commented 3 years ago

Fix is in https://github.com/mongodb-js/compass/issues/1962 - should make it into Compass 1.24.0 Feel free to try out the beta which has it already. Closing this, feel free to reopen if updating to this version doesn't fix. Thanks again for bringing it up!

kabamccortesdelafuente commented 3 years ago

It looks like it worked 👍 thanks for the support on this 😃

JoeySelahJr commented 3 years ago

This is still an issue for me. Compass Version 1.26.1 (1.26.1)

Is there any configuration necessary to get this working?

Anemy commented 3 years ago

@JoeySelahJr The fix should be in Compass version 1.26.1 (First landed in 1.24.1). What is the error you are receiving? Can you confirm your user has permissions to update documents? What is the shard key? Sorry it's not working for you.

JoeySelahJr commented 3 years ago

This is the error I'm receiving. The shard key is on a field named "location" which is on the document and it is populated. I'm verifying read/write access but that user was able to modify data in the atlas mongo web client.

image