Monday, December 12, 2011

Opening Multiple Instance of VISIO 2010

I had a strange issue with Visio 2010, unable to open multiple instance of Visio and its hard sometime to switch back between the diagrams. 

I found the fix for the issue and posting the solution here for others to follow
  1. Open your registry (Start >> Run>> regedit
  2. Open the following registry path "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Visio\Application\"
  3. Add a new Key>>  choose Binary Key and give it a name called "SingleInstanceFileOpen" 
  4. leave the default value "0 0 0".
  5. close the regedit window as well as all instance of Visio 

Open different instance of Visio and you should be good to go now...

Not sure why Microsoft did this injustice to Visio alone



Thursday, December 1, 2011

Mongo DB - Schema less database - Series 2



Overview:  In this section we'll see how to start the Mongo DB engine, create database and basic CRUD operations


Starting Mongo DB

The two "most important" applications are the mongo and mongod
applications. 

The mongo application allows you to use the database shell; this shell enables you to
accomplish practically anything you'd want to do with MongoDB.

The mongod application starts the service or daemon, as it's also called. There are also many flags you can set when launching the MongoDB applications


executing the mongod.exe from command prompt (Tips: Set the path in the environment variables, so that you don't need to navigate to the actual folders)



There is a nice comparison between Mongo DB and Oracle & My SQL in Mongo web site, a helpful tip for newbies http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart


I've listed down a key comparison between Mongo and other RDBMS
RDBMS
MONGO
Database
Database
Tables
Collections
Rows
Documents

In MongoDB, a document is an item that contains the actual data, comparable to a row in SQL.


Important Note:
Mongo DB is case-sensitive
$ symbol is reserved for many built-in functions


 
DATATYPES

String
Text values
Integer (32b and 64b)
Numerical values
Boolean
True or False
Double
Floating point values
Min/Max
Comparing values against Lowest  and Highest BSON elements
Arrays
Store array of values
Timestamp
Store Time stamp
Object
Object  type values
Null
Null values
Date*
Current Date
ObjectID*
Documents unique ID
Binary Data*
Binary format data
JavaScript Code*
Store JavaScript code
Regex*
Regular Expression type
*denotes BSON data types

 CRUD Operations

Before i dive in to CRUD operation with example, there are few important commands to do the basic operations like Listing all databases, connecteing to database,  listing all documents, etc...

One interesting command to remember is : 'Show'  this is almost a replacement for 'Select * from'


use
To switch to a db library
show dbs
To view available databases and collections
show collections
To view all available collections for your current database
system.indexes
All the indexed are stored here
db..renameCollection("Target DB")
Renaming a Collection
db..distinct("xxxxx")
Getting distinct data collection