Fantom is a great language that runs nice and quickly on the JVM. MongoDB is an excellent schema-free document oriented database. Rather than wrap the existing Java drivers, I decided to create a pure Fantom driver implementation, both to learn Fantom better and to learn more about Mongo's internals.
This project is still pretty new. Definitely not being used in any production capacity as of yet, but the test coverage is getting better all the time, and the code has remained relatively simple. Please don't hesitate to submit bug reports or (even better!) pull requests.
Fortunately not much - a Fantom 1.0.53 or later installation, and MongoDB (I've been testing against 1.1.4, you'll definitely want to run the test suite to see how it works with more recent releases until I get a chance to update myself)
For now, grab the code from hg, then cd into the top level dir.
fan build.fan and you're good to go - mongo.pod has been added to your system. Just add
using mongo at the top of a file/script in which you'd like to use it.
// insert m := Mongo() db := m.db("mytestdb") c := db["mycollection"] c.insert(["foofoo":345]) obj := c.findOne() // now, obj["foofoo"] == 345 c.remove(obj) // now, c.find().count == 0
For now, the best way to get into it is to go through the source and the tests. Once I figure out a good place to host some of the fandoc reference material, I'll add that as well.
- BSON serialization/deserialization for most types (http://www.mongodb.org/display/DOCS/BSON)
- single and bulk insert
- querying w/sort, limit and skip
- count on cursors
- group, distinct
- a variety of DB commands
- authentication and user management
- connection management (sort of...can probably be improved upon)
- GridFS - stream-oriented storage of arbitrarily large files
in no particular order...
- replica pairs / sharding support
- always more tests