You are on page 1of 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