Prabhu Sunderaraman

Fullstack Engineer, Programmer, Writer, Trainer

prabhu.bits@gmail.com,     GitHub     Youtube     LinkedIn
  • Home
  • Profile
  • Books
  • Reading List
Browsing: / Home
Shortlink

Getting started with MongoDB-II

By Prabhu Sunderaraman on October 8, 2013 in MongoDB, NoSQL

In the previous post we saw how to get started with mongodb by installing and starting up the server and the client. In this post let’s create a simple database and add some records.
I was on a TDD assignment last week mentoring a team. Using TDD, we developed a Quiz application that generated a set of questions from a question bank. I maintained the question bank in MongoDB. Let me use that example and show how to create a database called Quiz and add some questions to the database in MongoDB.

  • Let’s start the mongodb server and launch the client.
  • Create a new database called Quiz using the use command.
    use Quiz
    It will automatically create a database called Quiz and switch to that database as shown here.
  • Add a collection(or table) called Questions using the insert() function(or command) as shown here.
    db.Questions.insert(JSON data) is the general format.
    db.Questions.insert({question:”1+1=?”,choices:[“1″,”2″,”3″,”4″],answer:”2″})
    db.Questions.insert({question:”4+1=?”,choices:[“2″,”3″,”4″,”5″],answer:”5″})
    db.Questions.insert({question:”1+2=?”,choices:[“1″,”2″,”3″,”4″],answer:”3″})
    db.Questions.insert({question:”8-4=?”,choices:[“1″,”2″,”3″,”4″],answer:”4”})


    insert() is a JavaScript function and if you want to find that out you can type
    db.Questions.insert without paranthesis and you can see the code for insert function
  • If you want to see the list of all questions added, use db.Questions.find() function which will show the list of all questions like this.
    blog2
  • You can notice that the questions are added with a primary key value called _id which is a 12-byte value that is a combination of machine id, process id, timestamp and an auto-incremented value.
  • In the next post, let’s play with some more operations on the Questions data.

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Getting started with MongoDB – I

By Prabhu Sunderaraman on September 22, 2013 in MongoDB, NoSQL

MongoDB or huMONGOus DB is a NoSQL database. You will push JSON data in MongoDB. The data is actually stored in a binary formatted JSON or BSON.

Getting started with MongoDB is pretty easy.

  • Download the MongoDB zip from here.
  • Extract it and add the bin folder to the path.
  • Create a data folder in the MongoDB folder where all the data will be stored.
  • You can start the MongoDB server from command prompt using the mongod –dbpath [path of data folder] command as shown here.
    Blog
  • Start the mongoDB client from another command prompt window using mongo command like this.
    blog1
  • In the next post, let’s create a database and add JSON data to it.

    Share this on: Mixx Delicious Digg Facebook Twitter
    Shortlink

    Touch support for Ext JS 4

    By Prabhu Sunderaraman on September 12, 2013 in Ext JS, Sencha Touch

    One of the features that Ext JS 4 is coming up in the future release is support for touch events. With touch notebooks and desktops being used increasingly, Ext JS 4 is looking at providing responsive behavior to the touch gestures.

    Sencha Touch already supports touch events for mobile applications. To bring this feature into Ext JS 4 API, Sencha is looking at creating a sencha-core package that has the common features like the class system, touch events etc, bundled into it.

    Though the Ext JS 4 roadmap doesn’t give you much information about the release date, it’s a welcome feature and long pending too. You can read more about it here.

    Share this on: Mixx Delicious Digg Facebook Twitter
    Shortlink

    Video on Lists in Groovy

    By Prabhu Sunderaraman on September 2, 2013 in GoG, Video Sessions

    Here’s a 6 minute video on using Lists in Groovy.

    For more videos you can visit http://www.durasoftindia.com/Videos.aspx

    Share this on: Mixx Delicious Digg Facebook Twitter
    Shortlink

    Video on Getting started with Groovy

    By Prabhu Sunderaraman on August 23, 2013 in GoG, Video Sessions

    Here’s a 4 minute video on getting started with Groovy.

    For more videos you can visit http://www.durasoftindia.com/Videos.aspx

    Share this on: Mixx Delicious Digg Facebook Twitter
    « Previous 1 … 34 35 36 … 64 Next »

    Youtube Channel




    Categories

    • JavaScript (48)
      • RequireJS (5)
    • Go (44)
    • Golang (44)
    • Ext JS (23)
    • Spring (22)
    • Mobile (21)
    • Scala (20)
      • Play (3)
    • Uncategorized (19)
    • Video Sessions (18)
    • GoG (17)
    • Sencha Touch (16)
    • jQuery (14)
    • Languages (13)
    • Java 8 (12)
    • React JS (11)
    • Kotlin (11)
    • HealthyCodeMagazine (9)
    • Video (9)
    • Objective-C (8)
    • NoSQL (8)
    • Android (7)
    • MongoDB (7)
    • GWT (6)
    • Tools (6)
    • HTML 5 (5)
    • Cloud (5)
    • General (5)
    • Micro services (5)
    • Java (5)
    • Books (4)
    • AWS (4)
    • Software Architecture (4)
    • .NET (3)
    • Elixir (3)
    • Docker (3)
    • Reactive (3)
    • NodeJS (2)
    • RoR (2)
    • Backbone (1)
    • AngularJS (1)

    Archives

    • 2020 (49)
    • 2019 (7)
    • 2018 (34)
    • 2017 (15)
    • 2016 (7)
    • 2015 (18)
    • 2014 (31)
    • 2013 (55)
    • 2012 (100)

    Search

    Subscribe




    Copyright © 2025 Prabhu Sunderaraman.

    Powered by WordPress and News.