Prerequisites

  • new API is added and needs to be routed via API gateway
  • new API is a URL that has a unique /api/v1/.../ prefix

Solution

  1. attach to mongodb shell (mongodb namespace)
  2. mongosh --username=root
  3. use gatewaydb
  4. db.services.updateOne({'slug': 'SERVICE'}, {'$push': {'instances': 'NEW-INSTANCE'}}), where SERVICE is the name of service responsible for the API and NEW-INSTANCE is the name of the new API instance