Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1472

mongooplog has invalid example of option --database. filtering on database does not work.

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:

      Documentation page has an example of using --database option

      mongooplog  --from mongodb0.example.net --host mongodb1.example.net --database people --collection usage
      

      Stating

      In the next command, the parameters limit this operation to only apply operations to the database people in the collection usage on the target host (i.e. mongodb1.example.net):

      But the option does not work - I guess "-database" has been renamed to "-db":

      $ mongooplog --from 127.0.0.1:20000 --port 20010 --database d01
      ERROR: unknown option database
      

      Unfortunately when db is used the mongooplog does not act as described - it applies changes to all database - not only the one specified:

      Add doc to replica set "rs0" database "d02"

      rs0:PRIMARY> use d02
      switched to db d02
      rs0:PRIMARY> db.data.save({a:"02"})
      

      Apply oplog from rs0 to rs1 limiting to database 'd01' - change in d02 should not be replicated

      mongooplog --from 127.0.0.1:20000 --port 20010 -d d01
      

      but it appears on rs1 after that.

      rs1:PRIMARY> use d02
      switched to db d02
      rs1:PRIMARY> db.data.find()
      { "_id" : ObjectId("5182929363576b32f0144132"), "a" : "02" }
      

      Reporter: Sergei
      E-mail: sbobovich@gmail.com

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            auto auto
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 51 weeks ago