How to Setup Environment For MongoDB

To install the MongoDB on windows, first doownload the latest release of MongoDB from Make sure you get correct version of MongoDB depending upon your windows version. To get your windows version open command prompt and execute following command

C:\>wmic os get osarchitecture

32-bit versions of MongoDB only support databases smaller than 2GB and suitable only for testing and evaluation purposes.

Now extract your downloaded file to c:\ drive or any other location. Make sure name of the extracted folder is mongodb-win32-i386-[version] or mongodb-win32-x86_64-[version]. Here [version] is the version of MongoDB download.

Now open command prompt and run the following command

C:\>move mongodb-win64-* mongodb
      1 dir(s) moved.

In case you have extracted the mondodb at different location, then go to that path by using command cd FOLDER/DIR and now run the above given process.

MongoDB requires a data folder to store its files. The default location for the MongoDB data directory is c:\data\db. So you need to create this folder using the Command Prompt. Execute the following command sequence

C:\>md data
C:\md data\db

If you have install the MongoDB at different location, then you need to specify any alternate path for \data\db by setting the path dbpath in mongod.exe. For the same issue following commands

In command prompt navigate to the bin directory present into the mongodb installation folder. Suppose my installation folder is D:\set up\mongodb

D:\>cd "set up"
D:\set up>cd mongodb
D:\set up\mongodb>cd bin
D:\set up\mongodb\bin>mongod.exe --dbpath "d:\set up\mongodb\data"

This will show waiting for connections message on the console output indicates that the mongod.exe process is running successfully.

Now to run the mongodb you need to open another command prompt and issue the following command

D:\set up\mongodb\bin>mongo.exe
MongoDB shell version: 2.4.6
connecting to: test
> { a: 1 } )
{ "_id" : ObjectId(5879b0f65a56a454), "a" : 1 }

This will show that mongodb is installed and run successfully. Next time when you run mongodb you need to issue only commands

D:\set up\mongodb\bin>mongod.exe --dbpath "d:\set up\mongodb\data" 
D:\set up\mongodb\bin>mongo.exe

Advantages Of MongoDB


Any relational database has a typical schema design that shows number of tables and the relationship between these tables. While in MongoDB there is no concept of relationship

Advantages of MongoDB over RDBMS

  • Schema less : MongoDB is document database in which one collection holds different different documents. Number of fields, content and size of the document can be differ from one document to another.
  • Structure of a single object is clear
  • No complex joins
  • Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that’s nearly as powerful as SQL
  • Tuning
  • Ease of scale-out: MongoDB is easy to scale
  • Conversion / mapping of application objects to database objects not needed
  • Uses internal memory for storing the (windowed) working set, enabling faster access of data

Why should use MongoDB

  • Document Oriented Storage : Data is stored in the form of JSON style documents
  • Index on any attribute
  • Replication & High Availability
  • Auto-Sharding
  • Rich Queries
  • Fast In-Place Updates
  • Professional Support By MongoDB

Where should use MongoDB?

  • Big Data
  • Content Management and Delivery
  • Mobile and Social Infrastructure
  • User Data Management
  • Data Hub

Difference Between Constant and ReadOnly and Static

Constant and ReadOnly keyword are used to make a field constant which value cannot be modified. Static keyword is used to make members static that can be shared by all the class objects. In this article, I am going to explain the difference among these three.


Constant fields or local variables must be assigned a value at the time of declaration and after that they cannot be modified. By default constant are static, hence you cannot define a constant type as static.

public const int X = 10;

A const field is a compile-time constant. A constant field or local variable can be initialized with a constant expression which must be fully evaluated at compile time.

    void Calculate(int Z)
     const int X = 10, X1 = 50;
     const int Y = X + X1; //no error, since its evaluated a compile time
     const int Y1 = X + Z; //gives error, since its evaluated at run time

You can apply const keyword to built-in value types (byte, short, int, long, char, float, double, decimal, bool), enum, a string literal, or a reference type which can be assigned with a value null.

    const MyClass obj1 = null;//no error, since its evaluated a compile time
    const MyClass obj2 = new MyClass();//gives error, since its evaluated at run time

Constants can be marked as public, private, protected, internal, or protected internal access modifiers. Use the const modifier when you sure that the value a field or local variable would not be changed.


A readonly field can be initialized either at the time of declaration or with in the constructor of same class. Therefore, readonly fields can be used for run-time constants. (more…)

Value Type and Reference Types

typesinnetThe Types in .NET Framework are either treated by Value Type or by Reference Type. A Value Type holds the data within its own memory allocation and a Reference Type contains a pointer to another memory location that holds the real data. Reference Type variables are stored in the heap while Value Type variables are stored in the stack.

Value Types

value_typeA Value Type stores its contents in memory allocated on the stack. When you created a Value Type, a single space in memory is allocated to store the value and that variable directly holds a value. If you assign it to another variable, the value is copied directly and both variables work independently. Predefined datatypes, structures, enums are also value types, and work in the same way. Value types can be created at compile time and Stored in stack memory, because of this, Garbage collector can’t access the stack.

Examples : int, enum, structs.  


Apple iPhone Launch Event

Read more here : The 10 most important things from Apple’s iPhone 6S event

The 10 most important things from Apple’s iPhone 6S event

1. A novelty-sized iPad

Apple iPhone EYNTK

The new iPad Pro has the biggest screen on an iOS device (and a bigger screen than some OS X devices.) At 12.9 inches, it can support a full-sized virtual keyboard, and will be the first iPad to feature an optional physical keyboard and stylus. The Pro will have an A9X memory chip, making it 1.8x faster than the A8X chip that’s in the iPad Air 2, and Apple claims it’s faster than 80 percent of portable PCs (i.e. laptops) shipped in the past six months. The iPad Pro’s new four-speaker audio setup will also rebalance itself based on how you hold it. The 10-hour battery life and 5.6 million pixels will also help it compete with traditional laptops or other tablet and keyboard combinations.

Apple invited Microsoft and Adobe up to demonstrate iPad Pro-focused versions of their iOS apps Adobe Photoshop Fix is a new app that lets you quickly retouch photos using the stylus, while PowerPoint will now convert stylus ink into objects that you can use in your slides. The tablet is being positioned as a professional tool, with a price to match. The 32GB edition will cost you $799, while the 128GB will be $949, and LTE support bumps up the 128GB to $1079. The iPad Pro will be available in November in silver, gold, and space grey versions.

2. Styluses are hip again

Apple iPhone EYNTK

Steve Jobs may have famously trashed styluses when the original iPad came out, but times have changed. The $99 Apple Pencil is a dedicated iPad Pro stylus that will allow for precision drawing and can be used simultaneously with a finger. Granted, Apple is jumping into a market that’s been filled by third-party designers for years, so anyone who absolutely needed a stylus for the smaller, existing iPads probably already has one. The same goes for the other new iPad Pro peripheral: a $169 woven “smart keyboard” case that looks a lot like Microsoft’s surface keyboards. Even if they’re not new concepts, this is the first time Apple has made its own versions of these accessories, positioning them as an integral part of the product. They’ll be out in November, along with the iPad Pro.


Grey Box Testing

What is Grey Box Testing?

Grey Box testing is testing technique performed with limited information about the internal functionality of the system. Grey Box testers have access to the detailed design documents along with information about requirements.

Grey Box tests are generated based on the state-based models, UML Diagrams or architecture diagrams of the target system.


Gray-box testing Techniques:

  • Regression testing
  • Pattern Testing
  • Orthogonal array testing
  • Matrix testing


  • Grey-box testing provides combined benefits of both white-box and black-box testing
  • It is based on functional specification, UML Diagrams, Database Diagrams or architectural view
  • Grey-box tester handles can design complex test scenario more intelligently
  • The added advantage of grey-box testing is that it maintains the boundary between independent testers and developers


  • In grey-box testing, complete white box testing cannot be done due to inaccessible source code/binaries.
  • It is difficult to associate defects when we perform Grey-box testing for a distributed system.

Best Suited Applications:

Grey-box testing is a perfect fit for Web-based applications.
Grey-box testing is also a best approach for functional or domain testing.