This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
show dbs #shows all databases | |
use db_name #use database with given name(creates if does not exist) | |
Basic Queries | |
db.user.insert({name: {first: 'Rajesh', last: 'Thummalapally'}, skills: ["Ruby on Rails", "jQuery", "CSS", "HTML5", "C#"]}) | |
db.user.insert({name: {first: 'Teja', last: 'Thummalapally'}, skills: ["Ruby on Rails", "jQuery", "CSS", "HTML5", "Java", "Cooking"]}) | |
db.user.find() #returns collection | |
db.user.findOne() #returns first one from collection | |
TO update a user: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |