Technology

Free text search in MongoDb

MongoDb introduced free text search beta in its v2.4 but it was in experimental phase. In v.2.6, MongoDb has finally made its free text search (the most requested feature) production ready. In this post, we will have a look at how can we use this pretty useful feature that MongoDb offers us. To enable Free text search, Mongodb...

by Sakshi Tyagi
Tag: MongoDB
30-Jun-2014

Big Data, Grails

Our Experiences of MongoDB afternoon in New Delhi and Bangalore

We at IntelliGrape are an enthusiastic lot when it comes to technology conferences and knowledge sharing sessions. So lot of us were pretty excited to hear the news about mongoDB organising conferences in Delhi and Bangalore. More so, because we are early adaptors of MongoDB. Our entire Node.JS service line uses MongoDB as preferred...

by Narinder Kumar
Tag: MongoDB
30-May-2014

Node.js

_id With Mongoose

Let us take a very common use-case: "There will be a registration page for users, where users will provide their required details along with their picture”. Details would be saved to MongoDB while the pictures would be uploaded to Cloudinary or S3 with user unique id." Suppose we have User Schema as given below: [js] /* * Schema...

by Amit Kumar
Tag: MongoDB
12-Apr-2014

Node.js

Getting started with Mongoose !!

Mongoose is a Node.js package that gives you an interface to play with mongo database. Mongoose has all sets of methods that help you to connect and access data stored in database. It translates data from database in javaScript object which you can provide to your application. We will move step by step to know how it works. 1....

by ajay.mishra
Tag: MongoDB
07-Apr-2014

Node.js

Validation with Mongoose

In one of our Node.js projects, we used Mongoose module to interact with MongoDB. Mongoose provides us four types of built-in validation on schema as below: 1. Required: We can mark a field as required, which must be provided. 2. Limit: If field is type of Number in Schema, then we can restrict maximum and minimum value for that...

by Amit Kumar
Tag: MongoDB
19-Feb-2014

Technology

Capped Collections In Mongodb

We can create collections in mongoDb on which we can apply size limit. These special type of collections are called Capped Collections. These are a kind of circular queues, in which if allocated size limit is reached, it makes space for new documents by overwriting the oldest documents in the collection. How to create Capped...

by Sakshi Tyagi
Tag: MongoDB
26-Jan-2014

Technology

Group By in MongoDB(with $group)

MongoDB provides a rich set of aggregation. $group is one of them, with the help of $group, we can group documents (similar as group By in SQL). Lets understand by an example: Suppose we have following collection of blogs: [js] { userId:1, name:"Suroor", title:"AngularJS: Getting started with Directive", rating:3} { userId:2,...

by Amit Kumar
Tag: MongoDB
04-Oct-2013

Technology

How to Determine Average in MongoDB

MongoDB provides several ways of computing the average value of a group in a collection. One of the simplest ways of determining average is using the method db.collection.group(). The method db.collection.group() bunches the documents of a collection on the basis of the keys mentioned and executes aggregation functions on them. This...

by Sakshi Tyagi
Tag: MongoDB
02-Apr-2013

Technology

Node.js: Getting started with Express.js and MongoDB

In my previous post, I explained how to get started with node.js and executing your first script with node. Now in this tutorial, we will go a step ahead and learn using Expressjs and MongoDB. For people who are new, Express is a web application framework for node which provides a set of features that can be used to build single-page as...

by Suroor Wijdan
Tag: MongoDB
08-Feb-2013

Technology

Export very large data from a MongoDB collection using script

In this post, we will learn how to use javascript as MongoDB shell script to export (fields of) a collection.   If you just want to execute MongoDB commands then look at the another post there..   OK, so let's focus back to the objective of this post. Generally, to export data from a MongoDB collection, we use the...

by Salil
Tag: MongoDB
04-Jul-2012

Node.js

Executing MongoDB shell commands from Javascript file

MongoDB uses javascript interface for the shell commands. We can really use this feature in a great way - by writing the MongoDB (shell) commands in a javascript (.js file) and execute in single go. In this blog, I am going to show an example for the same: [javascript] print('===== My Demo Script ====='); ...

by Salil
Tag: MongoDB
29-Jun-2012