Friday, January 10, 2014

How to connect mongodb from console in Ubuntu

Access mongo from terminal:

Open Terminal with Ctrl + Alt + T then type below command:
mongo
List of all databases:
show dbs;
Select database for uses:
use db_development(db_name);
Display table list from db:
show tables;
Display data from table:
db.groups.find()
       where groups is a table name

Search content from table:

db.groups.find({name: "sachin"})
       where groups is a table name and name is field name

Set limit for display data from table:
db.groups.find().limit(2);

Saturday, January 04, 2014

Moped::Errors::ConnectionFailure (Could not connect to any secondary or primary nodes for replica set)

Solution:

For this error we need to remove mongod.lock first and for that use below command for remove that  and also restart server

sudo rm /var/lib/mongodb/mongod.lock
sudo service mongodb start
If you want to restart service then do it:
sudo service mongodb restart

Friday, January 03, 2014

Wednesday, January 01, 2014

Move Window Control Buttons to the Right

Step 1.) Open terminal with Ctrl + Alt + T then run this command:
sudo apt-get install gconf-editor
Step 2.) Press Alt + F2 then run this command :
gconf-editor
then press Enter

Step 3.) follow this flow and browse:
apps > metacity> general
Step 4.) Then look in right panel for "button_layout" and change value from close,minimize,maximize: to :minimize,maximize,close
then press Enter