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

add optional parameter dropTarget to DBCollection.rename()

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.5
    • Component/s: API
    • Labels:
      None
    • # Replies:
      3
    • Last comment by Customer:
      true

      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

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                7 years, 36 weeks, 5 days ago
                Date of 1st Reply: