File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,40 @@ document in |vscode-short| and view its contents.
103
103
2. Click :guilabel:`Delete Document`.
104
104
3. Click :guilabel:`Yes` to confirm.
105
105
106
+ *To insert a document*, you can:
107
+
108
+ 1. Right-click the collection where you want to insert a document.
109
+ #. Click :guilabel:`Insert Document`.
110
+
111
+ |vsce| opens the Playground with a template for adding a document to
112
+ the collection.
113
+
114
+ .. code-block:: json
115
+ :copyable: false
116
+ :caption: Example Playground Template
117
+ :linenos:
118
+ :emphasize-lines: 8-10
119
+
120
+ // MongoDB Playground
121
+ // Use Ctrl+Space inside a snippet or a string literal to trigger completions.
122
+
123
+ // The current database to use.
124
+ use('<database-name>');
125
+
126
+ // Create a new document in the collection.
127
+ db.getCollection('<collection-name>').insertOne({
128
+
129
+ });
130
+
131
+ #. Paste the document to add inside the
132
+ :method:`db.collection.insertOne()` method and click the
133
+ :guilabel:`Play Button`.
134
+
135
+ #. Click :guilabel:`Yes` to confirm.
136
+
137
+ The |vsce| :guilabel:`Playground Result` panel displays the ID of the
138
+ inserted document.
139
+
106
140
.. include:: /includes/admonitions/document-search-template.rst
107
141
108
142
Schema
You can’t perform that action at this time.
0 commit comments