DB_1_PORT_27017_TCP_ADDR not showing up inside docker container

I am following this tutorial to set up a Docker environment for a node.js + MongoDB application. As in the tutorial, I am creating two containers: one for node.js script (node_js container), and one for MongoDB (mongo container).

Accordingly to the tutorial, I should use DB_1_PORT_27017_TCP_ADDR environment variable to perform the connection between node_js and mongo. However, no value is returned from it:

node_js# echo $DB_1_PORT_27017_TCP_ADDR

node_js#

Here is my docker-compose.yml:

version: '3'
services:


  mongo:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: admin
      MONGO_INITDB_ROOT_PASSWORD: admin


  node_js:
    build: ./
    working_dir: /root/node_js
    command: >
      sh -c "npm install
             while sleep 1000; do :; done"
    links:
      - mongo

How can I configure the DB_1_PORT_27017_TCP_ADDR variable to connect to mongo? Am I missing something?

Thanks!

Source: StackOverflow