question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to edit document if field _id is not ObjectId

See original GitHub issue

Option Edit in context menu is inactive when trying to edit document with non ObjectId() value in _id field

Environment:

  • Ubuntu 18.04.1
  • Intellij IDEA 2018.2.1
  • Mongo plugin 0.12.0
  • MongoDB server 4.0

Steps:

  • prepare MongoDB server
  • add testing server to IDEA
  • prepare data for the test with the following commands:
    • > use somedb
    • > db.somecollection.insert({_id: “some-identifier0”, foo: “foo”, bar: “beer”})
    • > db.somecollection.insert({foo: “some-foo”, bar: “tequila”})
  • open test DB in IDEA
  • try to edit first and second documents

Actual result: document with non-ObjectId() _id field could not be editable

Expected result: user can edit all documents in DB using context menu and Edit option

Attachments: Video on Youtube

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
JosefBoukalcommented, Oct 28, 2018

Any plans to fix/support this feature?

1reaction
sturmancommented, Aug 9, 2018

I think, in 90% cases ObjectId is used, but _id may be of any type other than an array. mongodb docs

Read more comments on GitHub >

github_iconTop Results From Across the Web

MongoDB can't update document because _id is string, not ...
1 Answer 1 ... Because you can't modify the _id field, a better approach is to simply remove the that field from your...
Read more >
Why can't I change the _id field? #Studio3T_AMA | Studio 3T
As the _id field is immutable, you cannot change it and that's by design. This field is all about being the immovable reference...
Read more >
ArcMap says there is no Object-ID field, but there is, even after ...
When I add a .csv file, Display XY Data, I get an error that there is no Object-ID field (even though there is)....
Read more >
Warning: Data source does not have an OID field
Solution: Export the table or layer to a new table or feature class. More information: An ObjectID field is required to edit a...
Read more >
Failed to save document without define an _id in his model
The _id is generated with an objectId by default, even when not defining that field. You can change the field by defining it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found