dm-mongo-adapter musings

36 views
Skip to first unread message

Jason

unread,
Jul 26, 2010, 3:06:46 PM7/26/10
to DataMapper MongoDB Adapter
Hi list,
I've been working over the past few days to move our rails (2.x) and
sinatra apps to DM 1.0 with the intention of playing around with
mongodb. The setup described here:
http://lunarlogicpolska.com/blog/2010/02/15/mysql-and-mongodb-working-together-in-kanbanery
is exactly what we're looking to implement so I went forth with hope.
However, I've run into a few issues.

1. Logging - It would be nice to be able to see what dm-mongo-adapter
is doing under the hood. How do I enable logging for this adapter?
Setting logging: true doesn't seem to be working.

2. A few patches. See http://gist.github.com/491043. In summary:
storage_exists() didn't exist so I've stubbed it for now out of
ignorance, old type code was left in, and when using active support
2.x, DateTime.now.to_time only works when the DateTime object is
already in UTC. These patches apply to ac643c82.

3. Whenever dm-mongo-adaptor executes a query, I get this in the
mongos logs: "can't find cursor: 0." I haven't seen this error with
other mongo adapters (MM, Mongoid, etc) so I don't think it's an issue
with my mongo installation. However, I can't find any reference to
this error on the internets. Any ideas?

Cheers,
-Jason

solnic

unread,
Aug 2, 2010, 5:02:32 PM8/2/10
to DataMapper MongoDB Adapter
On Jul 26, 9:06 pm, Jason <aby...@gmail.com> wrote:
> Hi list,
>   I've been working over the past few days to move our rails (2.x) and
> sinatra apps to DM 1.0 with the intention of playing around with
> mongodb.  The setup described here:http://lunarlogicpolska.com/blog/2010/02/15/mysql-and-mongodb-working...
> is exactly what we're looking to implement so I went forth with hope.
> However, I've run into a few issues.
>
> 1.  Logging - It would be nice to be able to see what dm-mongo-adapter
> is doing under the hood.  How do I enable logging for this adapter?
> Setting logging: true doesn't seem to be working.

Logging is not implemented yet. If the ruby driver supports logging it
will be an easy task tho

> 2.  A few patches.  Seehttp://gist.github.com/491043.  In summary:
> storage_exists() didn't exist so I've stubbed it for now out of
> ignorance, old type code was left in, and when using active support
> 2.x, DateTime.now.to_time only works when the DateTime object is
> already in UTC.  These patches apply to ac643c82.

Thanks, I'm gonna look into these!

> 3.  Whenever dm-mongo-adaptor executes a query, I get this in the
> mongos logs: "can't find cursor: 0."  I haven't seen this error with
> other mongo adapters (MM, Mongoid, etc) so I don't think it's an issue
> with my mongo installation.  However, I can't find any reference to
> this error on the internets.  Any ideas?

No idea, but again - I'm gonna look into that :)

Thanks for the feedback,

// solnic
Reply all
Reply to author
Forward
0 new messages