01. mongoDB - Secret of the mongo shell
hi friends....
Open your command prompt type following codes
>cd\
>cd mongoDB\bin
>mongod
Open another command prompt type following codes
>cd\
>cd mongoDB\bin
>mongo
MongoDB shell version : 2.4.6
connecting to : test
>for(a=1; a<6; a++) print("welcome to all")
welcome to all
welcome to all
welcome to all
welcome to all
welcome to all
>for(a=11; a<17; a++) print(a)
11
12
13
14
15
16
>x=1
1
>y="mongoDB"
mongoDB
>z={b:23}
{ "b" : 23 }
>z.b
23
>z["b"]
23
output::::
try this woks
>x={"a":1};
>y="a";
>x[y]++;
>print(x.a);
find the Answare:
Next ===>mongoDB - create database & collection
0 comments: