Embed presentation
Downloaded 72 times



![Groovy + Mongo Java BasicDBObject doc = new BasicDBObject(); doc.put("name", "MongoDB"); doc.put("type", "database"); doc.put("count", 1); coll.insert(doc); Groovier def doc = [name:"MongoDB", count:1,type:"database", info: [x:203, y:102] ] as BasicDBObject coll.insert(doc) Grooviest (using groovy-mongo) coll.insert([name:"MongoDB", type:"database", info: [x:203, y:102]])](https://image.slidesharecdn.com/usingmongodbwithgroovy-100313121553-phpapp01/85/Using-MongoDB-With-Groovy-4-320.jpg)





Groovy and MongoDB are well-suited for each other because Groovy is a more concise way to write Java code and MongoDB is a flexible, schemaless database. Groovy allows dynamic queries of MongoDB through dynamic finders that parse method names to build queries without a predefined schema. Several projects use Groovy and MongoDB together effectively.



![Groovy + Mongo Java BasicDBObject doc = new BasicDBObject(); doc.put("name", "MongoDB"); doc.put("type", "database"); doc.put("count", 1); coll.insert(doc); Groovier def doc = [name:"MongoDB", count:1,type:"database", info: [x:203, y:102] ] as BasicDBObject coll.insert(doc) Grooviest (using groovy-mongo) coll.insert([name:"MongoDB", type:"database", info: [x:203, y:102]])](https://image.slidesharecdn.com/usingmongodbwithgroovy-100313121553-phpapp01/85/Using-MongoDB-With-Groovy-4-320.jpg)



