Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-238

add optional parameter dropTarget to DBCollection.rename()

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.5
    • 2.3
    • API
    • None

    Description

      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 ); }

      Attachments

        Activity

          People

            antoine Antoine Girbal
            grmblfrz Swen Thümmler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: