Java IDE Installation for Eclipse

This tutorial will guide you through configuring Eclipse for Java. Ensure you have followed the tutorial on installing Eclipse first.

You should open java and debug perspectives. To do that just go to “Window”–>”Open Perspective”–>”Java”. This opens Java perspective. To open “Debug” you need to go to “Window”–>”Open Perspective”–>”Other”. Select “Debug” and hit “Ok”.

You should also install Maven 2. Go to “Help”–>”Install New Software”. In the “Work With” type “http://m2eclipse.sonatype.org/sites/m2e” and hit “Add”. Then add the name “Maven2” or whatever name you want and hit “Ok”. Then check “Maven Integration for Eclipse” and hit “Next”. Hit “Next” again for “Install Details” and accept the license agreement. and hit “Finish”. You will need to restart.

If you want you can also open “Project Explorer”, “Markers” and “Problems” views from “Window”–>”Show View”–>”Other”.

FindBugs is also a nice to have and I recommend having it :). Go to “Help”–>”Install New Software”. In the “Work With” type “http://findbugs.cs.umd.edu/eclipse” and hit “Add”. Then add the name “FindBugs” or whatever name you want and hit “Ok”. Then check “FindBugs” and hit “Next”. Hit “Next” again for “Install Details” and accept the license agreement. and hit “Finish”. You will need to restart.

You should open the “FindBugs” perspective as well. To do that just go to “Window”–>”Open Perspective”–>”Other”. Select “FindBugs” and hit “Ok”.

Don’t forget to lock Eclipse to launcher if you want.

Optional:

TypeScript IDE:

Used for React. It’s really handy. Open Eclipse. Click Help–>Install New Software. In the “work with” put “http://oss.opensagres.fr/typescript.ide/1.1.0/” and click Add. Follow the prompts and you are done for now. make sure you select “Embed Node.js” and “TypeScript IDE”.

HTML Editor:

Used for HTML files. Click Help –> Eclipse Marketplace. Search for “HTML Editor”. Then click install. After it is installed and Eclipse is restarted Click Window –> Preferences –> Web. Under “HTML Files” change encoding to “ISO 10646/Unicode(UTF-8). Under “Editor” add “div”. You can get more info and configuration from here.

MongoDB Testing

MongoDB is a NoSQL type of database.

Installation on Windows is rather simple just follow the prompts. Just download from here. You can follow the installation instructions from here if you so choose. It has a max document size of 16MB but you can see all base configurations from here. Once you install MongoDB you will have to start the server. Run C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe. Then you can run C:\Program Files\MongoDB\Server\3.2\bin\mongo.exe to start querying the data.

MongoDB is a document db. Adhoc querying is easy if the data you are querying is within the 16MB max size. There is no tables in MongoDb they are called Collections instead. They are used to store bson documents. Which are basically json. Querying data is fast I have found. It uses the map reduce context to querying data. If you are not familiar with map reduce it’s basically just JavaScript.

I will have more later as I test more and more.

I have done some testing and can give you some basic code below.

Show All Collections:

 show collections

 

See All Databases:

 show dbs

 

Drop A Collection:

 db.COLLECTIONNAME.drop()

 

Drop All Collections:

 db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); })

 

Create A Collection:

 db.createCollection("logs", {autoIndexId: true})

 

Create An Index:

 db.logs.createIndex( { KEY: VALUE } )

 

MapReduce:

 db.COLLECTION.mapReduce(function(){
      var key = WHATEVER;
      var value = WHATEVER;

      emit(key, value);
},
function(key, values) {
      var output = {
            KEY: VALUE
      };
      return output;
}, {out: {inline: 1}})

 

Find matching element:
The .pretty() displays the json pretty.

 db.COLLECTIONNAME.find({ "KEY.SUBKEY.ARRAYINDEX" : VALUE }).pretty()

 

Find record that match in using greater and less than or equal to and display the id field associated.

 db.COLLECTIONNAME.find({ "KEY" : {$elemMatch: { $elemMatch: { $gt: 0.0005, $lte: 0.0005862095 } } } }, { id: "_id"  }).pretty()

 

Find record using IN and returning id field.

 db.COLLECTIONNAME.find({ "KEY" : { $in: [ 123,456 ] } }, { id: "_id" }).pretty()

 

You can loop through data and insert it into a new collection

 db.COLLECTIONNAME.find({ "KEY.SUBKEY.ARRAYINDEX" : 0 }).forEach(function(obj){ db.NEWCOLLECTION.insert(obj) })

 

CouchBase Testing

CouchBase is a NoSQL type of database.

Installation on Windows is rather simple just follow the prompts. Just download from here. Unfortunately at this time CouchBase on Windows wants you disable the firewall. I don’t recommend this and due to this critical issue itself do not currently recommend this until it has been fixed. Once installed it is viewable from http://localhost:8091. It has a max document size of 20MB but you can see all base configurations from here. CouchBase is a document db. It has fast importing of documents. CouchBase has views as like CouchDB. A view in CouchBase is like querying for data but not like CouchDB’s views. CouchBase still has Index’s. It’s view has a fast view rebuild which makes querying data faster than in CouchDB. It uses the map reduce context to creating views. If you are not familiar with map reduce it’s basically just JavaScript.

I will have more later as I test more and more.

I have done some testing with a view and can give you some syntax for writing one.

 function(doc, meta) {
      emit(meta.id, output);
}

CouchDB Testing

CouchDB is a NoSQL type of database. CouchBase is related but different entirely.

Installation on Windows is rather simple just follow the prompts. Just download from here. Once installed it is viewable from http://localhost:5984/_utils/. It has a max document size of 4GB but you can see all base configurations from here. CouchDB is a document db. If you come from a traditional relational setting then you might get frustrated at first because well querying documents is slow at first because you need to create a view. A view basically is kind of like an index from relational setting. Each different way you query the data you need to create a view. What get’s a little ridiculous is that as your data grows the view isn’t updated with newest data till the view is called. So at first it’s slow but each time it gets queried it gets faster. It uses the map reduce context to creating views. If you are not familiar with map reduce it’s basically just JavaScript.

I will have more later as I test more and more.

I have done some testing with a view and can give you some syntax for writing one.

 function(doc) {
      //Add any code you want
      emit(key, output);
}