title: I need to update data in angular from mongodb
body: <p><strong>I have an angular project with a springBoot api and a mongodb database
  My problem is that I need one of the components to update at the same time as information is injected into the database
  It is an order app where orders are made from a component and saved in the database</strong></p>
  <pre><code>  addOrder(): void{
  this.apiService.createOrder(
    this.username,
    this.pedido.tableNumber,
    this.pedido.platos,
    this.pedido.totalPrice
  ).subscribe( orderResponse =&gt; {
    if (orderResponse) {
      this.dialog.open(DialogOrderComponent);
    } else {
      this.dialog.open(DialogOrderFalseComponent);
    }
  })
  </code></pre>
  <p>}</p>
  <p><strong>but I need that when the database changes the new orders are shown in the component that is in charge of displaying them</strong></p>