GithubHelp home page GithubHelp logo

Comments (2)

rwynn avatar rwynn commented on May 29, 2024

Can you share what you have for these relevant configs? Routing namespaces should be configured to be the MongoDB name-space(s) that you are redirecting, not the destiny (index) your plugin sends to.

# tell monstache don't assume where ANY deleted doc will be, instead search for it by id
routing-namespaces = [ "" ]

# optional, instead, to be very specific, tell monstache you are redirecting events 
# from source namespace my_db.collection
# routing-namespaces = [ "my_db.collection" ]

# this is already the default (stateless)
delete-strategy = 0

# optional, if you still haven't had success you can try enabled this, allows monstache to delete more than 1 doc in Elastic
# if multiple docs match on the id
disable-delete-protection = true

# optional, if you want to restrict monstache to only search for docs to delete according to an index pattern
# the default is to search all indices
delete-index-pattern = "my_db.collection*"

Relevant delete handling code here:

func (ic *indexClient) doDelete(op *gtm.Op) {

Make sure it's going into the stateless block and that it's performing a search by having the following return true.

if routingNamespaces[""] || routingNamespaces[op.Namespace] {

If all else fails, you already have a go plugin, so you can implement the delete yourself by adding a Process function.

// all events including deletes flow through here.
func Process(input*monstachemap.ProcessPluginInput) error

from monstache.

Arenhardt avatar Arenhardt commented on May 29, 2024

I saw the problem trying to create my own solution. The watch event for deletion isn't like other ones that provide the doc body. So in my case that I was trying to route the deletion to the right index based on a value present on the doc it couldn't work.

So I created a delete-index-pattern = "my_db.collection*" on my config. It's not a solution with a wonderful performance (we need to search across all the indexes) but in my case, most of the records are updated to a status of removed instead of a record remotion so it will be performed rarely

Thank you for your help @rwynn !

from monstache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.