mongomod

MongoDB driver for haxe. Based on the 'mongodb' haxe library.
https://bitbucket.org/yar3333/haxe-mongomod

To install, run:

haxelib install mongomod 1.0.4 

See using Haxelib in Haxelib documentation for more information.

README.md

MongoDB driver for Haxe

Pure-haxe driver for MongoDB for sys targets. Based on https://github.com/MattTuttle/mongo-haxe-driver project.

Improvements (compared to base project):

  • production-ready (used by russian social network [http://vkrugudruzei.ru/](http://vkrugudruzei.ru/));
  • major refactored to avoid static methods (now support many connections to mongo instances);
  • Int64 always treated as Float (this prevent bugs when type hiddenly changed on records editing/importing/exporting);
  • support Date type;
  • several major bugfixes.

Find all objects in a collection

Finding rows in a relational database can be a daunting process. Thankfully with Mongo it's just like accessing a regular Haxe object instance.

import org.mongodb.Mongo;
...
var mongo = new Mongo("localhost", 27017);
for (post in mongo.blog.find())
{
	trace(post.title); // assumes that all posts have a title
}

Inserting and updating

import org.mongodb.Mongo;
...
var mongo = new Mongo("localhost", 27017);
var post = {
	title: 'My awesome post',
	body: 'MongoDB is easy as pie'
};
mongo.blog.posts.insert(post);

post.body = 'Made some updates to my post';
mongo.blog.posts.update({title: post.title}, post); // update the post
Contributors
yar3333
Version
1.0.4
Published
2 years ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github