0% found this document useful (0 votes)
21 views

Microsoft Windows

The document shows the log of a user connecting to MongoDB from the command line and running commands. The user navigates to the MongoDB bin directory, starts the mongo shell, checks the list of databases which includes local and mydb, inserts documents into the mydb.superstore collection, and finds the inserted documents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Microsoft Windows

The document shows the log of a user connecting to MongoDB from the command line and running commands. The user navigates to the MongoDB bin directory, starts the mongo shell, checks the list of databases which includes local and mydb, inserts documents into the mydb.superstore collection, and finds the inserted documents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Microsoft Windows [Version 6.3.

9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\psg>cd C:\mongodb\mongodb\bin

C:\mongodb\mongodb\bin>mongo.exe
MongoDB shell version: 2.4.9
connecting to: test
Server has startup warnings:
Mon Nov 27 08:48:27.614 [initandlisten]
Mon Nov 27 08:48:27.614 [initandlisten] ** NOTE: This is a 32 bit MongoDB
binary.
Mon Nov 27 08:48:27.614 [initandlisten] ** 32 bit builds are limited to
less than 2GB of data (or less with --journal).
Mon Nov 27 08:48:27.614 [initandlisten] ** Note that journaling
defaults to off for 32 bit and is currently off.
Mon Nov 27 08:48:27.614 [initandlisten] ** See
http://dochub.mongodb.org/core/32bit
Mon Nov 27 08:48:27.614 [initandlisten]
> show dbs
local 0.03125GB
mydb 0.0625GB
test 0.0625GB
> use mydb
switched to db mydb
> db.superstore.insert([{store_id:"s1",store_loc:"peelamedu",sto_phone:
[7868032189,9245484971], department:{dep_no:"1",dep_name:"groceries",
products:{pro_id:"p01",pro_name:"carrot",pro_price:"50"}}
}
])
> db.store.find().pretty()
{
"_id" : ObjectId("656599efba86078ef90475fb"),
"store_id" : "s1",
"store_loc" : "peelamedu",
"sto_phone" : [
7868032189,
9245484971
]
}
{
"_id" : ObjectId("656599efba86078ef90475fc"),
"dep_no" : "1",
"dep_name" : "groceries"
}
{
"_id" : ObjectId("656599efba86078ef90475fd"),
"pro_id" : "p01",
"pro_name" : "carrot",
"pro_price" : "50"
}
>
Microsoft Windows [Version 10.0.22000.2538]
(c) Microsoft Corporation. All rights reserved.

C:\Users\THARANI>cd C:\Users\THARANI\mongodb\mongodb\mongodb\bin

C:\Users\THARANI\mongodb\mongodb\mongodb\bin>mongo.exe
MongoDB shell version: 2.4.9
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
Thu Nov 30 04:56:54.641 [initandlisten]
Thu Nov 30 04:56:54.643 [initandlisten] ** NOTE: This is a 32 bit MongoDB
binary.
Thu Nov 30 04:56:54.643 [initandlisten] ** 32 bit builds are limited to
less than 2GB of data (or less with --journal).
Thu Nov 30 04:56:54.643 [initandlisten] ** Note that journaling
defaults to off for 32 bit and is currently off.
Thu Nov 30 04:56:54.643 [initandlisten] ** See
http://dochub.mongodb.org/core/32bit
Thu Nov 30 04:56:54.643 [initandlisten]
> show dbs
local 0.03125GB
> use mydb
switched to db mydb
> db.store.insert([{store_id:"s1",store_loc:"peelamedu",sto_phone:
[7868032189,9245484971], dep:{dep_no:"1",dep_name:"groceries"}, product:
{pro_id:"p01",pro_name:"carrot",pro_price:"50"}
... }
... ])
> db.store.find().pretty()
{
"_id" : ObjectId("6567c90a2e6a7ee700daa1ba"),
"store_id" : "s1",
"store_loc" : "peelamedu",
"sto_phone" : [
7868032189,
9245484971
],
"dep" : {
"dep_no" : "1",
"dep_name" : "groceries"
},
"product" : {
"pro_id" : "p01",
"pro_name" : "carrot",
"pro_price" : "50"
}
}
> db.superstore.insert(
[
{
store_id:"s1",
store_loc:"peelamedu",
sto_phone:
[7868032189,9245484971],
department:
[
{
dep_no:"1",
dep_name:"groceries",
products:
[
{pro_id:"p01",pro_name:"carrot",pro_price:"50"},
{pro_id:"p01",pro_name:"carrot",pro_price:"50"}
]

}}},

{dep_no:"2",dep_name:"cosmetics"},

{dep_no:"3",dep_name:"stationary"}],
}
]
)
> db.superstore.find().pretty()
{
"_id" : ObjectId("6567c98e2e6a7ee700daa1bb"),
"store_id" : "s1",
"store_loc" : "peelamedu",
"sto_phone" : [
7868032189,
9245484971
],
"department" : {
"dep_no" : "1",
"dep_name" : "groceries",
"products" : {
"pro_id" : "p01",
"pro_name" : "carrot",
"pro_price" : "50"
}
}
}
>

You might also like