com.mongodb.client.model.CreateViewOptions Java Examples

The following examples show how to use com.mongodb.client.model.CreateViewOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MongoDatabaseImpl.java    From mongo-java-driver-rx with Apache License 2.0 5 votes vote down vote up
@Override
public Observable<Success> createView(final String viewName, final String viewOn, final List<? extends Bson> pipeline,
                                      final CreateViewOptions createViewOptions) {
    return RxObservables.create(Observables.observe(new Block<SingleResultCallback<Success>>() {
        @Override
        public void apply(final SingleResultCallback<Success> callback) {
            wrapped.createView(viewName, viewOn, pipeline, createViewOptions, voidToSuccessCallback(callback));
        }
    }), observableAdapter);
}
 
Example #2
Source File: MongoDatabaseImpl.java    From mongo-java-driver-reactivestreams with Apache License 2.0 5 votes vote down vote up
@Override
public Publisher<Success> createView(final String viewName, final String viewOn, final List<? extends Bson> pipeline,
                                     final CreateViewOptions createViewOptions) {
    return new ObservableToPublisher<Success>(com.mongodb.async.client.Observables.observe(
            new Block<com.mongodb.async.SingleResultCallback<Success>>() {
                @Override
                public void apply(final com.mongodb.async.SingleResultCallback<Success> callback) {
                    wrapped.createView(viewName, viewOn, pipeline, createViewOptions, voidToSuccessCallback(callback));
                }
            }));
}
 
Example #3
Source File: MongoDatabaseImpl.java    From mongo-java-driver-reactivestreams with Apache License 2.0 5 votes vote down vote up
@Override
public Publisher<Success> createView(final ClientSession clientSession, final String viewName, final String viewOn,
                                     final List<? extends Bson> pipeline, final CreateViewOptions createViewOptions) {
    return new ObservableToPublisher<Success>(com.mongodb.async.client.Observables.observe(
            new Block<com.mongodb.async.SingleResultCallback<Success>>() {
                @Override
                public void apply(final com.mongodb.async.SingleResultCallback<Success> callback) {
                    wrapped.createView(clientSession.getWrapped(), viewName, viewOn, pipeline, createViewOptions,
                            voidToSuccessCallback(callback));
                }
            }));
}
 
Example #4
Source File: ReactiveMongoDatabaseImpl.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public Uni<Void> createView(String viewName, String viewOn, List<? extends Bson> pipeline,
        CreateViewOptions createViewOptions) {
    return Wrappers.toUni(database.createView(viewName, viewOn, pipeline, createViewOptions));
}
 
Example #5
Source File: ReactiveMongoDatabaseImpl.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public Uni<Void> createView(ClientSession clientSession, String viewName, String viewOn,
        List<? extends Bson> pipeline, CreateViewOptions createViewOptions) {
    return Wrappers
            .toUni(database.createView(clientSession, viewName, viewOn, pipeline, createViewOptions));
}
 
Example #6
Source File: MongoDatabaseImpl.java    From mongo-java-driver-reactivestreams with Apache License 2.0 4 votes vote down vote up
@Override
public Publisher<Success> createView(final String viewName, final String viewOn, final List<? extends Bson> pipeline) {
    return createView(viewName, viewOn, pipeline, new CreateViewOptions());
}
 
Example #7
Source File: MongoDatabaseImpl.java    From mongo-java-driver-reactivestreams with Apache License 2.0 4 votes vote down vote up
@Override
public Publisher<Success> createView(final ClientSession clientSession, final String viewName, final String viewOn,
                                     final List<? extends Bson> pipeline) {
    return createView(clientSession, viewName, viewOn, pipeline, new CreateViewOptions());
}
 
Example #8
Source File: ReactiveMongoDatabase.java    From quarkus with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that
 * defines the view.
 *
 * @param viewName the name of the view to create
 * @param viewOn the backing collection/view for the view
 * @param pipeline the pipeline that defines the view
 * @param createViewOptions various options for creating the view
 * @return a {@link Uni} emitting {@code null} when the operation has completed
 */
Uni<Void> createView(String viewName, String viewOn, List<? extends Bson> pipeline,
        CreateViewOptions createViewOptions);
 
Example #9
Source File: ReactiveMongoDatabase.java    From quarkus with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that
 * defines the view.
 *
 * @param clientSession the client session with which to associate this operation
 * @param viewName the name of the view to create
 * @param viewOn the backing collection/view for the view
 * @param pipeline the pipeline that defines the view
 * @param createViewOptions various options for creating the view
 * @return a {@link Uni} emitting {@code null} when the operation has completed
 */
Uni<Void> createView(ClientSession clientSession, String viewName, String viewOn,
        List<? extends Bson> pipeline,
        CreateViewOptions createViewOptions);
 
Example #10
Source File: MongoDatabase.java    From mongo-java-driver-rx with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.
 *
 * @param viewName the name of the view to create
 * @param viewOn   the backing collection/view for the view
 * @param pipeline the pipeline that defines the view
 * @param createViewOptions various options for creating the view
 * @return an observable identifying when the collection view has been created
 * @since 1.3
 * @mongodb.server.release 3.4
 * @mongodb.driver.manual reference/command/create Create Command
 */
Observable<Success> createView(String viewName, String viewOn, List<? extends Bson> pipeline, CreateViewOptions createViewOptions);
 
Example #11
Source File: MongoDatabase.java    From mongo-java-driver-reactivestreams with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.
 *
 * @param viewName the name of the view to create
 * @param viewOn   the backing collection/view for the view
 * @param pipeline the pipeline that defines the view
 * @param createViewOptions various options for creating the view
 * @return an observable identifying when the collection view has been created
 * @since 1.3
 * @mongodb.server.release 3.4
 * @mongodb.driver.manual reference/command/create Create Command
 */
Publisher<Success> createView(String viewName, String viewOn, List<? extends Bson> pipeline, CreateViewOptions createViewOptions);
 
Example #12
Source File: MongoDatabase.java    From mongo-java-driver-reactivestreams with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a view with the given name, backing collection/view name, aggregation pipeline, and options that defines the view.
 *
 * @param clientSession the client session with which to associate this operation
 * @param viewName the name of the view to create
 * @param viewOn   the backing collection/view for the view
 * @param pipeline the pipeline that defines the view
 * @param createViewOptions various options for creating the view
 * @return an observable identifying when the collection view has been created
 * @mongodb.driver.manual reference/command/create Create Command
 * @mongodb.server.release 3.6
 * @since 1.7
 */
Publisher<Success> createView(ClientSession clientSession, String viewName, String viewOn, List<? extends Bson> pipeline,
                              CreateViewOptions createViewOptions);