add optional parameter dropTarget to DBCollection.rename()

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 2.5
    • Affects Version/s: 2.3
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The mongodb shell allows to rename a collection and optionally drop the target. It would be great to be able to do this in the java driver, too. I.E.:
      public DBCollection rename( String newName, boolean dropTarget )
      throws MongoException

      { CommandResult ret = _db.getSisterDB( "admin" ) .command( BasicDBObjectBuilder.start() .add( "renameCollection" , _fullName ) .add( "to" , _db._name + "." + newName ) .add( "dropTarget", dropTarget) .get() ); ret.throwOnError(); resetIndexCache(); return _db.getCollection( newName ); }

            Assignee:
            Antoine Girbal (Inactive)
            Reporter:
            Swen Thümmler
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: