Skip to content

rodrigogdea/simple-mongo-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

simple-mongo-mapper

Is a non-intrusive mongodb mapper for java & scala

1st Case

case class User(name: String, age: Int)

MongoMapper.register("Users", Entity[User])

val user = new User("John Coltrane", 28)

// implicit DB  
MongoMapper.for("Users").add(user)
{ _id: 1234565, name: "John Coltrane", age: 28 }

2nd Case

case class Address(street: String)
case class User(name: String, age: Int, address: Address)

MongoMapper.register("Users", Entity[User])

val user = User("John Coltrane", 28, Address("Banfield"))

// implicit DB  
MongoMapper.for("Users").add(user)
 { _id: 1234565, name: "John Coltrane", age: 28, address: { street: "Banfield" } }

About

Is a non-intrusive mongodb mapper for java.

Resources

Stars

Watchers

Forks

Packages

No packages published