I am beginning to explore MongoDB and wish to write a small program/script using TCP socket to create a document in my local MongoDB community edition server. I would like to access MongoDB (which is now locally installed and running on my laptop) via a TCP socket.
I have installed MongoDB 4.2.3 community edition (with Compass.) As far as I can tell, it is running.
I can run mongo.exe shell:
C:\Program Files\MongoDB\Server\4.2\bin>mongo.exe
and the "show dbs" command yields what I would expect given that no documents or other data have been uploaded:
show dbs admin 0.000GB config 0.000GB local 0.000GB
Now, I would like to access mongodb via a TCP socket opened by my own (very small/simple) program so I can experiment with generating commands and observing responses (such as "show dbs").
When I telnet to localhost:27017 (using Windows 10 telnet client) telnet appears to connect to a socket (screen switches from "Connecting to localhost..." to a blank screen after a few seconds.)
As I am a beginner with MongoDB, I would appreciate a pointer as to how I can achieve my goal of using a small program I write to interact with MongoDB server.
Thank you, and I am happy to supply additional details as needed (and of course, would be grateful to a pointer to an example or other learning material that would help me proceed.)
Dave