Skip navigation

Monthly Archives: July 2013

netstat -an |find /i "listening"
netstat -an |find /i "listening" > c:\openports.txt

netstat -an |find /i "established"

netstat -no
1) Download mongoDB
2) extract it(no installation or dependencies needed): 
C:\mongodb\bin\mongod.exe --dbpath "c:\test\mongodb\data"
[--dbpath param if you want to specify another folder(\test\mongodb\data) instead of c:\data\db]
will contain your data
3)run mongo.exe
> { a: 1 } )

it works! the most esasy to install db ever

The mongo.exe shell will connect to mongod.exe running on the localhost interface and port 27017 by default. At the mongo.exe prompt, issue the following two commands to insert a record in the test collection of the default test database and then retrieve that record:

And now add some documents to any collection
Easy geo Spatial Example:
Add this document to  “places” collection
{ _id : ObjectId(...),
  name : "mr.v",
  loc : [55.5, 42.3]

with the command:

The following query would return documents from the "places" collection within the circle described by the center [55.5, 42] 
with a radius of 100 miles:

>db.places.find( { loc: { $geoWithin: { $centerSphere: [ [ 55.5 , 42.3 ] ,100 / 3959 ] } } } )


note: The radius of the Earth is approximately 3,959 miles or 6,371 kilometers.

Spring Data MongoDB: