Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any orm-like library for mongodb in scala?

It seems only the casbah we can use in scala, but I hope there is a orm-like library for scala, like morphia for java, or something else.

Is there any? I don't want to use morphia in scala because I have to convert java collections to scala


UPDATE

I've tried some of them, but still not find a proper one. Some are hard for scala newbies to get started.

FINALLY

Finally, I chose mongo-scala-driver, its awesome. Thanks to everybody.

like image 527
Freewind Avatar asked Mar 19 '11 02:03

Freewind


People also ask

Does ORM work with MongoDB?

Object-relational mapping (ORM) techniques make it easier to work with relational data sources and can bridge your logical business model with your physical storage model. Follow this tutorial to integrate connectivity to MongoDB data into a Java-based ORM framework, Hibernate.

Is PyMongo ORM?

1. PyMongo. The PyMongo MongoDB ORM for Python is a native and highly popular Python driver for MongoDB. It supports MongoDB versions MongoDB 2.6, 3.0, 3.2, 3.4, 3.6, 4.0, 4.2, 4.4, and 5.0.


2 Answers

There are two solid options:

Salat, which is designed to integrate with Casbah using case classes and scalasig - https://github.com/novus/salat/

Lift (liftweb.net) also has an activerecord ttype library for Mongo which Foursquare has built a DSL, Rogue, for. http://engineering.foursquare.com/2011/01/21/rogue-a-type-safe-scala-dsl-for-querying-mongodb/

like image 146
Brendan W. McAdams Avatar answered Nov 15 '22 20:11

Brendan W. McAdams


Spring Data is releasing Morphia-like mapping capabilities in the M2 of the MongoDB support. We've talked about doing some native Scala support for this but we haven't had anyone ask for it directly, so its hard to gauge interest. It should be usable as-is from Scala--though there are things I'd like to see us make more Scala-ish.

https://github.com/springsource/spring-data-document

like image 34
Jon Brisbin Avatar answered Nov 15 '22 20:11

Jon Brisbin