Class: EventStoreClient::GRPC::Commands::Projections::Update
- Defined in:
- lib/event_store_client/adapters/grpc/commands/projections/update.rb
Instance Method Summary collapse
Methods inherited from Command
Methods included from Configuration
Instance Method Details
#call(name, streams) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/event_store_client/adapters/grpc/commands/projections/update.rb', line 17 def call(name, streams) data = <<~STRING fromStreams(#{streams}) .when({ $any: function(s,e) { linkTo("#{name}", e) } }) STRING = { query: data, name: name, emit_enabled: true } service.update(request.new(options: ), metadata: ) Success() rescue ::GRPC::AlreadyExists Failure(:conflict) end |