-
Notifications
You must be signed in to change notification settings - Fork 10
/
README
36 lines (27 loc) · 1.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
== 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.