Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

What is NoSQL Database and its type

NoSQL is a non sql or we can say a non relational database management system. NoSQL is designed to support the requirements of cloud applications and to overcome issues like scalability, performance and data distribution limitations of relational...

How To Import MongoDB Database on Ubuntu 14.04?

Importing Information Into MongoDB If you want to import information into MongoDB database, lets take an example to import the database of resturants. It's in json format and can be downloaded using wget:   wget https://raw.gi...

MongoDB Connection With PHP

The MongoDB is built to work with your current web server, but not PHP. To communicate PHP with MongoDB server you need to install PHP-MongoDB driver. The PHP-MongoDB driver is a PHP extension library. The presently maintained driver for the Mong...

Data Modelling With MongoDB

Data in MongoDB contains a versatile schema. Documents that are in a same collection don't need to have an equivalent set of fields or structure, and common fields in an exceedingly collection's documents could hold differing kinds of dat...

MongoDB - Indexing

Indexes in MongoDB effective execution of query, Otherwise MongoDB must scan all documents inside of the collection to fetch document match the find statement. This scanning process is profoundly inefficient and require the MongoDB to handle a va...

MongoDB supported datatypes

Supported datatypes by MongoDB is given below: String: That is normally employed datatype for you to store the data. String inside mongodb have to be UTF-8 legitimate. Integer: This kind is utilized for you to store a new statistical worth....

MongoDB Query Plan & Optimization

Indexes improve the efficiency of read operations by reducing the amount of data that query operations need to process. Create index for a collection : The index can be defined in schema of collection. Consider the following collection Accounts...

MongoDB Query Optimization using explain

The MongoDB query optimizer processes chooses the most efficient query plan form the available indexes. Then mongoDB query system use this index to execute and return the result. You can use the db.collection.explain() or the cursor.explain() ...

MongoDB Sharding explained

Sharding is a method for storing data into multiple distributed machines. Database systems with large data sets and high throughput applications can challenge the capacity of a single server. To prevent this MongoDB Sharding concept used. In S...

Two Phase commits in MongoDB

Hello All, In this we will discuss about how to perform two phase commit in MongoDB. Consider a example where funds will be transferred from one account to another. In a relation database approach we just subtract fund from account a and ad...

Displaying Cursor Information in MongoDB

As we know cursor in mongoDB can be defined as return value of query run to mongoDB. The information of can be display using cursor.explain() function as show in below: db.collection.find().explain() The explain() method returns a documen...

Cursor In MongoDB

In mongo shell when find() query executed it return cursor with all document in the collection. However, if the returned cursor is not assigned to any variable then first 20 documents iterated automatically. In other word when a query run to m...

MongoDB : Javascript function

MongoDB - Javascript function $where operator : It uses to either a string containing a JavaScript expression. The full JavaScript function also used in the query system. This feature available after MongoDB version >= 2.4. List of prop...

MongoDB : $exist and $type operator

MongoDB - $exist and $type operator $type operator : It matches values based on their BSON type. e.g. We want to fetch documents from the collection which contains the value of "city" is only null. db.collection.find( { "city" : { $typ...

MongoDB : Regex

MongoDB - Regular Expression In MongoDB if we need to find record with certain pattern, then we can use regular expression. It is also "like" query in SQL. e.g. If we want to find user email matching with "findnerd.com" pattern. db.colle...

MongoDB : Sorting

MongoDB - Sorting In any application we need to show list in certain order. Generally we show's user feeds in descending order. This can be achieve in MongoDB through "sort" properties. e.g. We need to sort student name in ascending order....

MongoDB : Limit and Skip

MongoDB - Limit with Skip Often we need to implement pagination in any application. We can use "limit" with "skip". "skip" will select record from given index. e.g. We need to find 10 record started form 10th index. db.collection.find()....

MongoDB : Skip

MongoDB - Skip Query Sometime we need to find out certain number of record after a certain number of record. e.g. We need to find out 10 record start after 10th index db.collection.find().skip(10).pretty(); It is equivalent in SQl: ...

MongoDB : Limit

MongoDB - Limit Query Sometime we need to find out certain number of record. In MongoDB we can achieve this through "limit" option. e.g. We need to find 10 record from any collection. db.collection.find().limit(10).pretty(); It is e...

Download mongoDB data as csv file

Want to export MongoDB collection data to a csv file use mongoexport utility that produces data in JSON or CSV format. Use the following command to export data: mongoexport --host <hostName> --db <databaseName> --collection <...

Restore Directly from a Snapshot

As explained on post how to archive a snapshot, Now to restore a backup without writing to a compressed gz file from created archive, use the following sequence of commands: umount /dev/vg0/snap_db-01 lvcreate --size 1G --name mdb-new vg0 dd...

Restore a Snapshot

As explained on post how to archive a snapshot, Now to restore a snapshot from created archive, use the following sequence of commands: lvcreate --size 1G --name mdb-new vg0 gzip -d -c snap_db-01.gz | dd of=/dev/vg0/mdb-new mount /dev/vg0/md...

Creating a mongDB snapshot with LVM

Snapshot can be represented by creating pointers (equivalent to hard links ) between special snapshot volume and live data. The snapshot process uses a copy-on-write strategy. As a result the snapshot only stores modified data. The primary pu...

How to solve [MongoError: connect ECONNREFUSED]

Hello Readers, I came across a solution while working on mongodb and would like to share with you all in case you face any such problem while working on mongodb. If you are coming across the error like the following: Connection error: {...

Fetching data from Solr using Solarium

We seldom need to fetch result from solr based on limit and order by clause similar to sql queries , the same thing can be achieved using the below given code packet with solarium : // create a client instance $client = new Solarium\Client($...

How to make group by query in MongoDb

Making a group by query in traditional database like MySQL,MySQL etc in quite easy but when its come to NoSQL like MongoDb we have to twist it a bit to get result we want : There are two ways in which you can do group by in MongoDb : a) Usi...

Solution for Invalid Object ID in MongoDb

We usually have this kind of error while making query with mongodb "Uncaught exception 'MongoException' with message 'Invalid object ID'" , the main reason behind this kind of error is that :-> a) Id string for mongodb must be 24 hexadecim...

How to make like query in MongoDb

Below is the way you can make like query in MongoDb : It can basically be achieved by using MongoRegex $where=array(); if($param['searchfor']!=""){ $regexObj = new MongoRegex("/".$param['searchfor']."/ig"); ...

Why use NoSQL over Relational Database - Chapter 1

What is NoSQL? NoSQL is not a relational database it has been developed keeping in mind few of the drawbacks of relational database. It was developed for the purpose of data stored about users, objects and the frequency in which the data is ac...
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: