Skip to main content

Posts

Showing posts from November, 2014

MongoDB Tutorials : Aggregation Framework

MongoDB Aggregation Framework groups set of documents together and performs certain operation on this grouped documents and returns results in the form of documents. MongoDB aggregation answer to those query which requires grouping of documents. Aggregation framework works on three type of model Aggregation pipeline Map Reduce Single Purpose Aggregation Operations Now let see how MongoDB Aggregation Framework works with simple example. Suppose you are MongoDB application developer in a respected company and you have been given a MongoDB database that holds information about human population which is distributed according to cities and their states. here is one sample document. { "city" : "ACMAR" , "loc" : [ - 86.51557 , 33.584132 ], "pop" : 6055 , "state" : "AL" , "_id" : "3500

PHP Tutorials : Autoload PHP Classes

With some examples, this tutorial post will teach the PHP autoloader and namespace concepts. What is Autoloading in PHP? PHP autoload's primary function is to load PHP files into the application context. The import statement is the default method to include PHP file into context. However, we may avoid the issue by using the PHP autoload capability to autoload essential PHP files, which keeps your code clean and composable. Why do we need auto loading? When creating object-oriented applications, many developers create one PHP source file per class declaration. One of the major inconveniences is having to start each script with a huge list of required includes. Autloading allows us to include an arbitrary number of PHP files in the application context if they aren't already included by other include statements.  PHP Autoloading Methods PHP uses two functions; one is the magic method spl_autoload_register  and the other is   __autoload . Although __autoload has been

Subscribe for latest tutorial updates

* indicates required