Thursday, June 27, 2013

About me and my blog

A collection of google searches that I made for my day to day work.

About Me:

I am a Web Application Developer with specialization in J2EE based applications.  Most of my googled wisdom is likely to contain these keywords :

Groovy, Grails, Hibernate, Java etc.

MongoDB low level querying through grails mongodb plugin


This example displays MongoDB querying on multiple fields with multiple filters on any given field using grails MongoDB Plugin

Fetch all the people who have their lastName as "spencer" but their firstName must not be 'Mark' with salary between 10000 and 30000.

Person.collection.find('lastName':'Spencer',firstName: ['$ne':'Mark'], salary: ['$gt':10000, '$lt':30000])

Note:

We need to use single quotes while writing $gt, $ne, $lt etc because if we use double quote then grails tries to evalue $gt and hence results in error