I inserted the documents into a particular database in mongoDB. for example
db.employee.insert({name:"nithin",age:22})
db.employee.insert({name:"sreedevi",age:32})
now i wnat to retrive the documents whose name ending with character 'i'.
In Javascript shell, use $regex operator
db.employee.find({name: {$regex: "i$"}})