How to debug Firestore Function onCreate()?

Viewed 27

I have a Firebase Function with onCreate() function, which I would like to debug. My goal is, that when I add a new element in the Firebase Database, to stop the app at the breakpoint in the onCreate() function.

I tried to follow these steps but it's not working.

export const buySellSignal = functions.database.ref("/users/{userId}/signals/{signalId}")
  .onCreate((snapshot, context) => {
    const signal = snapshot.val();

    if (signal.type == "Buy") {
      buy(signal.pair, signal.userId);
    } else {
      sell(signal.pair, signal.userId);
    }

    database.ref(`users/${context.params.userId}/signals/${context.params.signalId}`).remove();
});
0 Answers
Related