Over a million developers have joined DZone.
Platinum Partner

Motor Progress Report

· Java Zone

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Motor, my async driver for MongoDB and Tornado, is now compatible with all the same CPython versions as Tornado: 2.5, 2.6, 2.7, and 3.2!

PyPy support is coming soon. Update: PyPy is supported, too. Motor now supports exactly the same Python versions Tornado does.

To get Motor working with Python 3 I had to make a backwards breaking change: MotorCursor.next is now next_object. So this:

cursor = db.collection.find()
cursor.next(my_callback)

... must now be:

cursor = db.collection.find()
cursor.next_object(my_callback)

I had to do this to neatly support Python 3, because 2to3 was unhelpfully transforming MotorCursor.next into __next__. But the change was worthy even without that problem: next_object is closer to nextObject in the Node.js MongoDB driver, whose API I'm trying to emulate. Besides, I wasn't using next the way Python intends, so I went ahead and renamed it. I'm sorry if this breaks your code. This is what the alpha phase is for.

The only remaining feature to implement is GridFS, which I'll do within the month. There's some more testing and documentation to do, and then we'll move from alpha to beta.

I know a few people are trying out Motor. I've received no bug reports so far, but some users have reported omissions in the docs which I've filled in. If you're using Motor, get in touch and let me know: jesse@10gen.com.

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Published at DZone with permission of A. Jesse Jiryu Davis , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}