can you allow "_id" Field clipboard copy
Hello!
I want to use "find" query using "_id" field.
But I cant copy my doc's _id field.
Mongo's docs often have other doc's _id for reference field.
But At Compass, cant copy _id field.
So difficult to find by _id.
Can you allow copy _id field?
Thank you!
Available in Compass 1.23+.
-
Matthew commented
@Massimiliano Appreciate this is possible but having to switch views and then re-open up the document and it's nested keys to easily copy an _id is painful. Needing to copy ObjectIds is quite common and currently it takes/wastes quite a lot of time overall
-
Edwin commented
You can work around this by switching to edit mode, then selecting it. It's also inconsistent how you can switch to edit mode - you can double click on most values to do so - but not the _id field's value (other ObjectID values work).
-
Matthew commented
Just to add to this that you can drag and highlight any other ObjectId fields other than the top level _id field in the default view.
It would be useful to have a copy button next to any ObjectIDs as we (and I'm sure many others) regularly need to copy them - same sort of idea as with GitHub commit ids - see attached screenshot. Clicking and dragging / double clicking to "edit" (even though we are not editing the document) and then highlighting the ObjectId is quite slow.
Thanks! - love Compass!
-
AdminMassimiliano (Admin, MongoDB) commented
Although this can be improved, it is possible to copy the _id by switching to JSON mode. You don't get the ObjectId part but that you get with autocomplete from the query bar.