public cfData execute(cfSession _session, cfArgStructData argStruct ) throws cfmRunTimeException { MongoDatabase db = getMongoDatabase( _session, argStruct ); String collection = getNamedStringParam(argStruct, "collection", null); if ( collection == null ) throwException(_session, "please specify a collection"); String name = getNamedStringParam(argStruct, "name", null); if ( name == null ) throwException(_session, "please specify a name"); try{ db .getCollection( collection ) .renameCollection( new MongoNamespace( db.getName(), name ), new RenameCollectionOptions().dropTarget( getNamedBooleanParam(argStruct, "droptarget", false ) ) ); return cfBooleanData.TRUE; } catch (MongoException me){ throwException(_session, me.getMessage()); return null; } }
@Override public Observable<Success> renameCollection(final MongoNamespace newCollectionNamespace, final RenameCollectionOptions options) { return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() { @Override public void apply(final SingleResultCallback<Success> callback) { wrapped.renameCollection(newCollectionNamespace, options, voidToSuccessCallback(callback)); } }), observableAdapter); }
@Override public Publisher<Success> renameCollection(final MongoNamespace newCollectionNamespace, final RenameCollectionOptions options) { return new ObservableToPublisher<Success>(observe(new Block<SingleResultCallback<Success>>() { @Override public void apply(final SingleResultCallback<Success> callback) { wrapped.renameCollection(newCollectionNamespace, options, voidToSuccessCallback(callback)); } })); }
@Override public Publisher<Success> renameCollection(final ClientSession clientSession, final MongoNamespace newCollectionNamespace, final RenameCollectionOptions options) { return new ObservableToPublisher<Success>(observe(new Block<SingleResultCallback<Success>>() { @Override public void apply(final SingleResultCallback<Success> callback) { wrapped.renameCollection(clientSession, newCollectionNamespace, options, voidToSuccessCallback(callback)); } })); }
@Override public void renameCollection(MongoNamespace arg0, RenameCollectionOptions arg1) { collection.renameCollection(arg0, arg1); }
@Override public Observable<Success> renameCollection(final MongoNamespace newCollectionNamespace) { return renameCollection(newCollectionNamespace, new RenameCollectionOptions()); }
public void renameCollection(String target, boolean dropTarget) { getCollection().renameCollection(new MongoNamespace(mongoDatabase.getName(), target), new RenameCollectionOptions().dropTarget(dropTarget)); }
@Override public Publisher<Success> renameCollection(final MongoNamespace newCollectionNamespace) { return renameCollection(newCollectionNamespace, new RenameCollectionOptions()); }
@Override public Publisher<Success> renameCollection(final ClientSession clientSession, final MongoNamespace newCollectionNamespace) { return renameCollection(clientSession, newCollectionNamespace, new RenameCollectionOptions()); }
/** * Rename the collection with oldCollectionName to the newCollectionName. * * @param newCollectionNamespace the name the collection will be renamed to * @param options the options for renaming a collection * @return an Observable with a single element indicating when the operation has completed * @mongodb.driver.manual reference/commands/renameCollection Rename collection */ Observable<Success> renameCollection(MongoNamespace newCollectionNamespace, RenameCollectionOptions options);
/** * Rename the collection with oldCollectionName to the newCollectionName. * * @param newCollectionNamespace the name the collection will be renamed to * @param options the options for renaming a collection * @return a publisher with a single element indicating when the operation has completed * @mongodb.driver.manual reference/commands/renameCollection Rename collection */ Publisher<Success> renameCollection(MongoNamespace newCollectionNamespace, RenameCollectionOptions options);
/** * Rename the collection with oldCollectionName to the newCollectionName. * * @param clientSession the client session with which to associate this operation * @param newCollectionNamespace the name the collection will be renamed to * @param options the options for renaming a collection * @return a publisher with a single element indicating when the operation has completed * @mongodb.driver.manual reference/commands/renameCollection Rename collection * @mongodb.server.release 3.6 * @since 1.7 */ Publisher<Success> renameCollection(ClientSession clientSession, MongoNamespace newCollectionNamespace, RenameCollectionOptions options);