I believe it's the opposite issue - you cannot specify a database when using the oplog option. The code you found:
if (mongoRestoreGlobalParams.oplogReplay) {
// fail early if errors
if (toolGlobalParams.db != "") {
toolError() << "Can only replay oplog on full restore" << std::endl;
return -1;
}
triggers when you both specify oplogReplay AND a database.
Keep in mind the oplog is for the entire mongodb instance, not a specific database. I believe taking a mongodump using --oplog is going to dump the entire instance and therefore it cannot be re-loaded into just one database.
It's fairly poorly documented. Mongolab alludes to it in their documentation:
Point-in-time method
Applicable to Dedicated plans only
If you have a Dedicated plan, you can take server-wide mongodumps to export all of the databases on the server.
This method is useful because it allows you to use the the --oplog and --oplogReplay options to mongodump and mongorestore (respectively). The options allow for a point-in-time snapshot of the server by also including the oplog in the dump. This oplog is then replayed when you use the --oplogReplay option upon restore.
but it's not very clear.