-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Playground results aren’t always cursors or documents returned from the database. We account for that and still have the current way of showing results (without the explicit document handling capabilities like the edit document code lens). In those cases, like if a string is returned, let's keep the existing editor view of the output. It's lighter weight than starting up the webview, and we don't need the functionality of the data browser.
We provide the ability for folks to edit the documents that are returned in playground results when the result is from a collection and the documents have _ids.
Code lens that provides the action:
Playground results: https://github.com/mongodb-js/vscode/blob/72619c7a6572c2eb73de61f146e8679559850c0f/src/language/languageServerController.ts#L180
We maintain this behavior in the new view, we’ll flag documents as editable when they’re passed to the webview.
There is a limitation here, which already exists, in that if the user projects or changes the _id value of the documents returned, we could end up editing an unintended document. This is something we allow as the user will still open the document when editing which will show them the current state of the document. For instance:
db.collection.aggregate([
{
$project:
{ _id: "$name" }
}
]);
We don’t show the + add document when showing playground results, or the `Refresh` button.
- depends on
-
VSCODE-730 Remove the data browsing feature flag; release the feature
-
- Needs Triage
-