Making a trigger so that when a document is updated , inserted , replaced the embeddings of it is updated/added

Got it. A few things:

  1. You are getting errors by using print() which is not a thing, please use console.log()
  2. I think the issue is that you are just running this locally by clicking the button in the function console? Does that sound right? If so, it is likely that the issue is that the function is operating on the premise that it has a change event being passed into it (which it will when you run it from the trigger), but when you are testing it locally it is just passing in a string as the input. See below for an example of how to pass in a change event as input (it is the default when you create a function while creating a trigger).

More importantly, can you try performing the action on the database that results in the error and link me to that message in the logs? I am not seeing anything in the logs for your application that align with the error messages you have shared. ,

1 Like