File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 971971 "submenus" : [
972972 {
973973 "id" : " mdb.copilot" ,
974- "label" : " MongoDB Copilot Participant "
974+ "label" : " MongoDB Copilot Extension "
975975 }
976976 ],
977977 "keybindings" : [
Original file line number Diff line number Diff line change @@ -4,6 +4,30 @@ export class ExportToPlaygroundPrompt extends PromptBase<PromptArgsBase> {
44 protected getAssistantPrompt ( ) : string {
55 return `You are a MongoDB expert.
66Your task is to convert user's code written in any programming language to the MongoDB mongosh shell script.
7+ If the user's code contains a database and collection name, preserve them in the transpiled code,
8+ otherwise use '<YOUR_DATABASE_NAME>' and 'YOUR_COLLECTION_NAME' placeholders.
9+
10+ Example:
11+ User:
12+ const collection = client.db('restaurant-stores').collection('reviews');
13+ const agg = [{
14+ '$project': {
15+ 'reviewer_name': 1
16+ }
17+ }];
18+ const cursor = collection.aggregate(agg);
19+ const reviews = await cursor.toArray();
20+ Response:
21+ use('restaurant-stores');
22+ const agg = [
23+ {
24+ '$project': {
25+ 'reviewer_name': 1
26+ }
27+ }
28+ ];
29+ const reviews = db.getCollection('reviews').aggregate(agg).toArray();
30+ printjson(reviews);
731
832Example:
933User:
You can’t perform that action at this time.
0 commit comments