• Home
  • Tags

Morphia

A collection of 2 posts

#Java #MongoDB #Morphia #Map-Reduce

Map-Reduce with MongoDB and Morphia

Just a note to record the usage of Map-Reduce with MongoDB and Morphia. Firstly, add the Morphia dependency. <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver</artifactId> <version>2.11.2</version> </dependency> <dependency> <groupId>org.mongodb.morphia</groupId> <artifactId>morphia</artifactId> <version>0.105</version> </dependency> The syntax of MapReduceCommand in Morphia as shown in MapReduceCommand.java: public MapReduceCommand( DBCollection inputCollection, String map, String reduce, String outputCollection, OutputType type, DBObject query) { // Compiled Code } Here we want to group the sales amount (i.e., subtotal) of each county and exclude the null-subtotal from collection. ...

Author 2 min
#MongoDB #Morphia #Java #NoSQL

Using MongoDB with Morphia

Morphia - The JVM Object Document Mapper for MongoDB. MongoDB is an extremely useful document-based database in NoSQL field. There are various drivers and client libraries in MongoDB Ecosystem and detailed manual to facilitate the developers to get into it shortly. In the beginning, we use MongoDB Java driver to manipulate CRUD operations on databases. Everything is running well but lots of BasicDBObject cause the code lack of readability and fluency. ...

Author 3 min
Page 1 of 1 
© 2019
Latest Posts Github LinkedIn