minor: update README

This commit is contained in:
Mike Dirolf 2009-07-13 12:18:05 -04:00
parent 3c6a02fd19
commit 242d0020a5

View File

@ -1,11 +1,6 @@
= Introduction
This is a Ruby driver for the 10gen Mongo DB. For more information about
Mongo, see http://www.mongodb.org.
Start by reading the XGen::Mongo::Driver::Mongo and XGen::Mongo::Driver::DB
documentation, then move on to XGen::Mongo::Driver::Collection and
XGen::Mongo::Driver::Cursor.
This is a Ruby driver for MongoDB[http://www.mongodb.org].
Here is a quick code sample. See the files in the "examples" subdirectory for
many more.
@ -23,8 +18,7 @@ many more.
coll.find().each { |doc| puts doc.inspect }
This driver also includes an implementation of a GridStore class, a Ruby
interface to Mongo's GridFS storage. NOTE: the GridStore code may be moved to
a separate project.
interface to Mongo's GridFS storage.
= Installation
@ -78,7 +72,6 @@ Here's how to start mongo and run the "simple.rb" example:
See also the test code, especially tests/test_db_api.rb.
= The Driver
Here is some simple example code:
@ -143,25 +136,15 @@ string.
== Primary Keys
The field _id is a primary key. It is treated specially by the database, and
its use makes many operations more efficient.
The value of an _id may be of any type. (Older versions of Mongo required that
they be XGen::Mongo::Driver::ObjectID instances.)
The database itself inserts an _id value if none is specified when a record is
inserted.
The driver automatically sends the _id field to the database first, which is
how Mongo likes it. You don't have to worry about where the _id field is in
your hash record, or worry if you are using an OrderedHash or not.
its use makes many operations more efficient. The value of an _id may be of
any type. The database itself inserts an _id value if none is specified when
a record is inserted.
=== Primary Key Factories
A primary key factory is a class you supply to a DB object that knows how to
generate _id values. Primary key factories are no longer necessary because
Mongo now inserts an _id value for every record that does not already have
one. However, if you want to control _id values or even their types, using a
PK factory lets you do so.
generate _id values. If you want to control _id values or even their types,
using a PK factory lets you do so.
You can tell the Ruby Mongo driver how to create primary keys by passing in
the :pk option to the Mongo#db method.
@ -285,30 +268,6 @@ Then open the file html/index.html.
See the git log comments.
= To Do
* Tests for update and repsert.
* Add a way to specify a collection of databases on startup (a simple array of
IP address/port numbers, perhaps, or a hash or something). The driver would
then find the master and, on each subsequent command, ask that machine if it
is the master before proceeding.
* Introduce optional per-database and per-collection PKInjector.
* More tests.
== Optimizations
* Only update message sizes once, not after every write of a value. This will
require an explicit call to update_message_length in each message subclass.
* ensure_index commands should be cached to prevent excessive communication
with the database. (Or, the driver user should be informed that ensure_index
is not a lightweight operation for the particular driver.)
= Credits
Adrian Madrid, aemadrid@gmail.com