Skip navigation

Monthly Archives: July 2013

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


ESTABLISHED
netstat -an |find /i "established"

ACTIVE
netstat -no
1) Download mongoDB http://www.mongodb.org/downloads
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]
\data\db
will contain your data
3)run mongo.exe
>db.test.save( { a: 1 } )
>db.test.find()

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:
> db.places.save({user:"mr.v",loc:[55.5,42.3]})


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: