Translate

26 February 2017

What is MongoDB?
SQL
not allowed





MongoDB is an open source document database with the scalability and flexibility that you want with the querying and indexing that you need.
MongoDB supports dynamic schema design, allowing the documents in a collection to have different fields and structures. The database uses a document storage and data interchange format called BSON, which provides a binary representation of JSON-like documents.

  • MongoDB stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time.
  • The document model maps to the objects in your application code, making data easy to work with.
  • Ad hoc queries, indexing, and real time aggregation provide powerful ways to access and analyze your data.
  • MongoDB is a distributed database at its core, so high availability, horizontal scaling, and geographic distribution are built in and easy to use.
  • MongoDB is free and open-source, published under the GNU Affero General Public License.

Install the MongoDB

Go to the https://www.mongodb.com/ website and download the mongodb.


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 on that location.
or
If you have to install the MongoDB at a different location, then you need to specify an alternate path for \data\db by setting the path dbpath in mongod.
command: mongod --dbpath [PATH_TO_DATA_DIRECTORY]

Start MongoDB

⊿Go to the mongodb installed directory.


⊿Then open the mongod server.


mongod is a primary daemon process for the mongodb system. It handles data requests, manages data access, and performs background management operations.

⊿After open the mongo application.


Some commands

display already exist databases



switched to database(create a new or use already exist)



display the current switched database


add the following document(primary) to the database(Student)


primary: primary school students
each results stored separate document(primary) in mongodb.
add same record without error. Because mongodb generate unique ObjectId. 

display the all document values


display the all document values in arrange format


ObjectId is added by mongodb. It's act as primary key(unique).

display the particular name document


used regular expression to find the document

  • db.primary.find({"name":/a/})          //like %a%
  • db.primary.find({"name":/^a/})        //like a%
  • db.primary.find({"name":/a$/})        //like %a


ᐅ update the particular document



remove the particular document



13 February 2017


What is a MEAN Stack?

MEAN is a JavaScript development stack that helps you build fast, robust, and maintainable production web applications using MongoDB, Express, AngularJS, and NodeJS. 


MEAN stack back-end with MongoDB, ExpressJS and NodeJS.
MEAN stack front-end with AngularJS.


Why do I care?

    ➤Write one language. 
    ➤With MongoDB and Mongoose, easy and flexible data validation.
    ➤With NodeJS, never need threads. 
    ➤With AngularJS, dynamic client-side templates.

Same Language, Same Objects

MEAN Stack Structure


More Information


MongoDB is the leading NoSQL database, empowering businesses to be more agile and scalable. It’s designed for storing non-relational data. It’s included in the stack because it’s queried using JSON and can persist objects as serialized JSON, making it ideal for JavaScript clients. It’s fast, open-source, flexible and cross-platform document-oriented database, suited for simpler applications.


Express is a lightweight Node.js web application framework. Node provides a http module by default but it’s very low level. Express wraps this up to provide simple get/post methods and other routing. In the stack, it glues everything together, and it’s also written in JavaScript. It's providing a robust set of features for building single and multi-page, and hybrid web applications.




AngularJS  is a front end JavaScript framework developed by Google, UI and client side logic of the stack. The application’s structure is defined in HTML and extended by AngularJS directives. Control logic is nicely separated into Controllers which are easy to re-use and organize. Angular brings a lot to bear in reducing complexity but at the cost of less control. It provides comprehensive features such as the two-way data binding, routing, DI of services.  It's a complete solution for rapids and awesome front end development.


Node JS is a platform built on Chrome's V8 JavaScript engine runtime for easily building fast, scalable network applications. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node is useful as it allows the server to push to the client over web sockets, helping to create responsive web applications. It was included in the stack to as it provides the server-side processing and it’s applications are written in JavaScript. It also brings npm, a package popular package manager, to the party.


06 February 2017

Who am I?

Hi...
I'm Sri Sathveegan. I'm reading Software Engineering specialization at SLIIT. I create this blog for my study purpose and this block is helped to developers who are interested in coding.