GitXplorerGitXplorer
g

embedded-mongo

public
122 stars
10 forks
2 issues

Commits

List of commits on branch master.
Unverified
db309362b9069796ceffdbb494f49e86dc26a7b2

Merge pull request #9 from morkeleb/master

ggdb committed 11 years ago
Unverified
586f82f32a4f2e0fd21944734a71d74c3ed90037

adding support for mixing and and or operations

mmorkeleb committed 12 years ago
Unverified
6ddd57c9b772ffb5af483da615912d95084ef013

adding support to look in arrays for values

mmorkeleb committed 12 years ago
Unverified
9dc96b9297fc752edabe4f571f6761ebabfe645e

adding support for directives

mmorkeleb committed 12 years ago
Unverified
f727ed68356cc42a38f3650f89d5925528c07959

Bump fake version

ggdb committed 12 years ago
Unverified
41832fbfea8b6f7c2c8ebb89048d92e146ce8f81

Tweak $inc code

ggdb committed 12 years ago

README

The README file for this repository.

== What ==

A Ruby implementation of the MongoDB interface.

Just swap out the line "Mongo::Connection.new" in your application with "EmbeddedMongo::Connection.new" and leave the rest of the code alone. No server process needed!

E.g.

conn = EmbeddedMongo::Connection.new
coll = conn['test']['embedded']
coll.insert({ 'hello' => 'world' })
coll.find.to_a
# => [{"_id"=>BSON::ObjectId('4e1b4027f626214e9e000001'), "hello"=>"world"}]

== Goal ==

embedded-mongo's goal is to provide the same interface as mongodb but be embedded inside the calling process. This allows unit tests to be run without the overhead of database roundtrips or the creation of ad-hoc mock layers. It also allows one to start using the mongodb interface for new projects without having to set up a real database. I don't think there's a use-case for it in production, though I could be wrong.

== Status ==

Most of the query semantics have been coded. Many of the database management operations have not. Nothing involving execution of JavaScript has been coded, because that sounds like work. Persistence hasn't been added, though that could be as easy as a Marshal or YAML dump when needed.

I think the next thing to add is indexes. Currently everything works via a linear scan of the database.