This is my first post as using the mongodb. First, I just downloaded the installer file from mongodb site. There are some points to remember if you install mongodb for the first time.
create c:\mongodb folder
- this is to be used for the custom installation
create \data\db folder
- put under the mongodb folder, use for database data file
create \logs
- for the mongodb log file
open powershell by run by administrator access and execute below command
>.\mongod.exe --directoryperdb --dbpath c:\mongodb\data\db --logpath c:\mongodb\logs\mongo.log --logappend --rest --install
start the mongodb service
>net start MongoDB
> show dbs
admin 0.000GB
local 0.000GB
> use mycustomers
switched to db mycustomers
> db
mycustomers
> show dbs
admin 0.000GB
local 0.000GB
> db
mycustomers
> db.createUser({
... user:"brad",
... pwd:"1234",
... roles: ["readWrite", "dbAdmin"]
... });
Successfully added user: { "user" : "brad", "roles" : [ "readWrite", "dbAdmin" ] }
> db.createCollection('customers');
{ "ok" : 1 }
> show collections
customers
> db.customers.insert({first_name:"John", last_game:"Doe"});
WriteResult({ "nInserted" : 1 })
> db.customers.find();
{ "_id" : ObjectId("5965cba0a07b84a6ed70301a"), "first_name" : "John", "last_game" : "Doe" }
Tuesday, July 11, 2017
Subscribe to:
Posts (Atom)
free online comma separating tool
https://delim.co/#
-
In my current company, I'm using Visual Paradigm for my documentation task. If you go there site, you can either download community and ...
-
One of the functionality in our system is can able to generate a report using Jasper report. We have a Jasper server setup in another ip ad...
-
I used KeePass long time ago and until now I'm still using it. It's a great tool to save your password encrypted. At my home, I sa...