722 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
67
views
Mongosh 2.x only display the result of the last command when running multiple commands?
I recently upgraded from Mongosh 2.0.1 and noticed a change in behavior when running multiple commands in the shell.
In older versions of Mongosh, if I ran:
JavaScript
\> db.a.find();
-- output of ...
0
votes
1
answer
65
views
mongoDB output client driver name only from currentOp function
I'm in no way a mongoDB expert.
I try to get the currentOp.clientMetadata.driver for every currentOp currently running.
I know how to filter to get all the operation that have a field clientMetadata:
...
1
vote
0
answers
63
views
Why don't Ctrl+L or the clear command work in Git Bash after using mongosh, unlike in VS Code's Bash or PowerShell? How can I fix this?
When I use the mongosh command in Git Bash and try to clear the screen using Ctrl+L or the clear command, it doesn't work. However, both commands work fine in the VS Code terminal, whether in Bash or ...
0
votes
0
answers
89
views
Differences in Shutdown Output Between mongo Shell and mongosh Shell
I am encountering differing outputs when trying to shut down my MongoDB server using the mongo shell and the mongosh shell, and I want to understand why this is happening.
I executed the following ...
-1
votes
1
answer
124
views
Mongodb is not connecting to Node.js and no error messages [closed]
I'm new to Node.js and MongoDB. I installed all packages as specified in a YouTube tutorial. I tried a lot to connect MongoDB with Node.js, but there is no error messages and it is not connected. I ...
0
votes
0
answers
41
views
Issue iterating over collections in MongoDB from mongo shell
I am trying to create a script that connects to a MongoDB instance, selects a database, lists all the collections from a database and then creates a schema to use for validation from a sample of ...
1
vote
2
answers
971
views
Unable to Connect to MongoDB with TLS and Authentication
Issue: Unable to Connect to MongoDB with TLS and Authentication
MongoDB Setup:
I’m running MongoDB on a Docker container, and I’ve enabled TLS/SSL and role-based access control (RBAC) with internal ...
0
votes
1
answer
53
views
In MongoDB 'show dbs ' command show mongodbserver[unauthorized ]
enter image description here
i did my installation with help of YouTube tutorial. after that in my cmd i typed mongosh , it shows perfectly as show in the tutorial and then i write 'show dbs' command ...
2
votes
1
answer
56
views
MongoDB: drop collection created with special characters
How do I drop the Mongo collection created with special characters?
Collection name: arpit^Crxcurrencies02
I tried:
db.arpit^Crxcurrencies02.drop();
Error:
ReferenceError: Crxcurrencies02 is not ...
0
votes
0
answers
83
views
Error mongodb Json parameter disallowed in create mode
I am in mongodb Atlas Compass, with the mongosh terminal, Im trying to add a collection to Deportes database with a document included that adds a collection named Futbol. I succeded the first time but ...
2
votes
1
answer
1k
views
Mongo Shell prompts for "it" when I want all results
How can I run a query that I know will return a large dataset without having to type "it" to see all result and without modifying the query itself?
I want to redirect all output to a file, ...
0
votes
1
answer
132
views
$set not working for runCommand update when trying to copy values into a new value
So I have a collection called dummyCollection where I’ve defined two string properties called username and passoword. Username is declared as string and password as binData. I want to use these two to ...
-1
votes
2
answers
152
views
When i Access Mongodb from the cmd using mongosh command, it returns Access Denied
I intsalled MongoDB on my windows 11 computer, but when i run mongosh in my cmd it returns access denied
>mongosh access Denied
this is what appears when i run the command
i tried uninstalling and ...
0
votes
1
answer
75
views
How to add a new field with the reference field through Mongo shell
I have an address field value inside basicDetails. I want that value to bring to the root field by adding a new field named address, so I am trying this way to add a new field address in all the ...
0
votes
1
answer
455
views
SSL mode is set to ‘preferred’ and connection to remote is not using SSL
I have cluster of 3 shards servers, 3 Config servers and 1 mongos server in dev environment. I would like to make communication between Mongo components TLS compulsory and communication between ...