README.md in mosql-0.2.0 vs README.md in mosql-0.3.0

- old
+ new

@@ -90,11 +90,11 @@ MongoDB `_id` field will be mapped to an SQL `id` column. At present, MoSQL does not support using the dot notation to access elements inside arrays. -As a shorthand, you can specify a one-elment hash of the form `name: +As a shorthand, you can specify a one-element hash of the form `name: TYPE`, in which case `name` will be used for both the source attribute and the name of the destination column. You can see this shorthand for the `title` and `created` attributes, above. Every defined collection must include a mapping for the `_id` @@ -125,11 +125,11 @@ `mosql` will: 1. Create the appropriate SQL tables 2. Import data from the Mongo database - 3. Start tailing the mongo oplog, propogating changes from MongoDB to SQL. + 3. Start tailing the mongo oplog, propagating changes from MongoDB to SQL. After the first run, `mosql` will store the status of the optailer in the `mongo_sql` table in your SQL database, and automatically resume where it left off. `mosql` uses the replset name to keep track of @@ -141,18 +141,15 @@ You likely want to run `mosql` against a secondary node, at least for the initial import, which will cause large amounts of disk activity on the target node. One option is to specify this in your connect URI: - mosql --mongo mongodb://node1,node2,node3?slaveOk=true + mosql --mongo mongodb://node1,node2,node3?readPreference=secondary -(You should be able to specify `?readPreference=secondary`, but the -Mongo Ruby driver does not appear to support that usage. I've filed a -[bug with 10gen][bug-read-pref] about this omission). +(Note that this requires you be using at least version 1.8.3 of +`mongo-ruby-driver`) -[bug-read-pref]: https://jira.mongodb.org/browse/RUBY-547 - ## Advanced usage For advanced scenarios, you can pass options to control mosql's behavior. If you pass `--skip-tail`, mosql will do the initial import, but not tail the oplog. This could be used, for example, to do an @@ -182,9 +179,27 @@ into `_extra_props`. There's no reason we couldn't support JSON-encoded values for individual columns/fields, but we haven't written that code yet. [plv8]: http://code.google.com/p/plv8js/ + +## Authentication + +At present, in order to use MoSQL with a MongoDB instance requiring +authentication, you must: + +- Have a user with access to the admin database. +- Specify the `admin` database in the `--mongo` argument +- Specify the username and password in the `--mongo` argument + +e.g. + +``` +mosql --mongo mongdb://$USER@$PASSWORD:$HOST/admin +``` + +I have not yet tested using MoSQL with 2.4's "roles" support. Drop me +a note if you figure out anything I should know. ## Sharded clusters MoSQL does not have special support for sharded Mongo clusters at this time. It should be possible to run a separate MoSQL instance against