MongoDB or CouchDB Example

162 views
Skip to first unread message

Charles Thompson

unread,
Sep 19, 2010, 10:33:43 PM9/19/10
to Lift
Does anyone know of a simple hello world lift project is that uses
MongoDB or CouchDB as its persistance layer?

I found http://github.com/alaz/pocketchangeapp, but this app is way
more complex than hello world. For example, in net.liftweb.mongodb
you'll find the trait ProtoUser implementation which exceeds 600 lines
of code.

I was hoping that the MongoDB library that comes with Lift would
already have implemented such things, and that somewhere on the Web
there would be an example.

Thanks,

Charles

Tim Nelson

unread,
Sep 20, 2010, 8:21:47 AM9/20/10
to lif...@googlegroups.com
Hi Charles,

Unfortunately there's not a full example app with Lift-MongoDB and the
app you linked to does not use Lift-MongoDB.

There are a bunch of examples in the source tests, however. They can
be found here:

http://github.com/lift/lift/tree/master/framework/lift-persistence/lift-mongodb/src/test/scala/net/liftweb/mongodb/

and here

http://github.com/lift/lift/blob/master/framework/lift-persistence/lift-mongodb-record/src/test/scala/net/liftweb/mongodb/record/

Tim

> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>

David Bernard

unread,
Sep 20, 2010, 8:59:21 AM9/20/10
to lif...@googlegroups.com

ghostM

unread,
Sep 20, 2010, 11:07:08 AM9/20/10
to Lift
FYI: The ToDo app will not work with Lift 2.1 because there were some
breaking changes to Record - http://groups.google.com/group/liftweb/browse_thread/thread/4f3a84e939c02d3c

(I'll try and update the ToDo app this week and make a MongoDB version
of it too)

Another good place to start are the wiki pages for Couch and Mongo
http://www.assembla.com/wiki/show/liftweb/CouchDB
http://www.assembla.com/wiki/show/liftweb/MongoDB

-Matt



On Sep 20, 6:59 am, David Bernard <david.bernard...@gmail.com> wrote:
> http://github.com/ghostm/lift-todo-couchdb
>
> <http://github.com/ghostm/lift-todo-couchdb>/davidB
>
>
>
> On Mon, Sep 20, 2010 at 14:21, Tim Nelson <tnell...@gmail.com> wrote:
> > Hi Charles,
>
> > Unfortunately there's not a full example app with Lift-MongoDB and the
> > app you linked to does not use Lift-MongoDB.
>
> > There are a bunch of examples in the source tests, however. They can
> > be found here:
>
> >http://github.com/lift/lift/tree/master/framework/lift-persistence/li...
>
> > and here
>
> >http://github.com/lift/lift/blob/master/framework/lift-persistence/li...
>
> > Tim
>
> > On Sun, Sep 19, 2010 at 9:33 PM, Charles Thompson
> > <charleswthompson...@gmail.com> wrote:
> > > Does anyone know of a simple hello world lift project is that uses
> > > MongoDB or CouchDB as its persistance layer?
>
> > > I foundhttp://github.com/alaz/pocketchangeapp, but this app is way
> > > more complex than hello world. For example, in net.liftweb.mongodb
> > > you'll find the trait ProtoUser implementation which exceeds 600 lines
> > > of code.
>
> > > I was hoping that the MongoDB library that comes with Lift would
> > > already have implemented such things, and that somewhere on the Web
> > > there would be an example.
>
> > > Thanks,
>
> > > Charles
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > > To post to this group, send email to lif...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .

Charles Thompson

unread,
Sep 20, 2010, 2:10:25 PM9/20/10
to Lift
Thanks guys for the response. Much appreciated from a noob Scala/Lift
dev.

On Sep 20, 8:07 am, ghostM <henderson.matt...@gmail.com> wrote:
> FYI: The ToDo app will not work with Lift 2.1 because there were some
> breaking changes to Record -http://groups.google.com/group/liftweb/browse_thread/thread/4f3a84e93...
>
> (I'll try and update the ToDo app this week and make a MongoDB version
> of it too)
>
> Another good place to start are the wiki pages for Couch and Mongohttp://www.assembla.com/wiki/show/liftweb/CouchDBhttp://www.assembla.com/wiki/show/liftweb/MongoDB

ghostM

unread,
Sep 20, 2010, 9:00:08 PM9/20/10
to Lift
Updated the CouchDB example to Lift 2.1RC2
also added http://github.com/ghostm/lift-todo-mongodb

-Matt

On Sep 20, 12:10 pm, Charles Thompson <charleswthompson...@gmail.com>
wrote:
> Thanks guys for the response. Much appreciated from a noob Scala/Lift
> dev.
>
> On Sep 20, 8:07 am, ghostM <henderson.matt...@gmail.com> wrote:
>
>
>
> > FYI: The ToDo app will not work with Lift 2.1 because there were some
> > breaking changes to Record -http://groups.google.com/group/liftweb/browse_thread/thread/4f3a84e93...
>
> > (I'll try and update the ToDo app this week and make a MongoDB version
> > of it too)
>
> > Another good place to start are the wiki pages for Couch and Mongohttp://www.assembla.com/wiki/show/liftweb/CouchDBhttp://www.assembla....

dan reportbug

unread,
Sep 23, 2010, 4:30:01 AM9/23/10
to Lift
Hi,

Just want to ask how to modify Boot.scala to talk to MongoDB instead
of h2 ?

Is MongoDB consider a JNDI or application connection ?

-Dan

On Sep 21, 9:00 am, ghostM <henderson.matt...@gmail.com> wrote:
> Updated the CouchDB example to Lift 2.1RC2
> also addedhttp://github.com/ghostm/lift-todo-mongodb

Tim Nelson

unread,
Sep 23, 2010, 6:33:27 AM9/23/10
to lif...@googlegroups.com
Hi,

You just need to add a line like the following:

MongoDB.defineDb(
DefaultMongoIdentifier,
MongoAddress(MongoHost(), "lift_app")
)

You can remove the code that sets up H2. For more info see:

http://github.com/eltimn/lift-mongo-protouser/blob/master/src/main/scala/bootstrap/liftweb/Boot.scala

Tim

> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

dan reportbug

unread,
Sep 23, 2010, 9:43:48 PM9/23/10
to Lift
Cool. Thanks. Tim.

On Sep 23, 6:33 pm, Tim Nelson <tnell...@gmail.com> wrote:
> Hi,
>
> You just need to add a line like the following:
>
> MongoDB.defineDb(
>   DefaultMongoIdentifier,
>   MongoAddress(MongoHost(), "lift_app")
> )
>
> You can remove the code that sets up H2. For more info see:
>
> http://github.com/eltimn/lift-mongo-protouser/blob/master/src/main/sc...
>
> Tim
Reply all
Reply to author
Forward
0 new messages