### Instruction:
Create a Python web application using Flask that allows users to upload audio files, transcribes the audio using the Google Speech-to-Text API, and displays the transcription along with the uploaded file's metadata (file name, duration, format). The application should store the uploaded files and transcriptions in a MongoDB database for future retrieval.

### Response:

To create this web application, you'll need to have Python and the following libraries installed:

1. Flask
2. google-cloud-speech
3. pymongo
4. pydub

You can install them using pip:

```bash
pip install flask google-cloud-speech pymongo pydub
```

Next, create a new directory for your project and set up your environment variables. You will need to create a Google Cloud account and enable the Speech-to-Text API to get an API key. Save the JSON file containing the API key in your project directory and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.

```bash
export GOOGLE_APPLICATION_CREDENTIALS="path/to/your/api_key.json"
```

Now, let's create the main application file, called `app.py`.

```python
from flask import Flask, request, render_template, redirect, url_for
from google.cloud import speech_v1p1beta1 as speech
from pymongo import MongoClient
from pydub import AudioSegment
import os
import io


app = Flask(__name__)
client = MongoClient("mongodb://localhost:27017/")
db = client["audio_transcriptions"]
collection = db["transcriptions"]


@app.route("/", methods=["GET", "POST"])
def index():
    if request.method == "POST":
        audio_file = request.files["file"]
        filename = audio_file.filename
        audio_format = filename.split(".")[-1]
        audio_file.save(filename)

        # Get duration of the audio file
        audio = AudioSegment.from_file(filename)
        duration = len(audio) / 1000

        # Transcribe the audio file
        transcription = transcribe_audio(filename)

        # Store the uploaded file and transcription in MongoDB
        collection.insert_one(
            {
                "filename": filename,
                "duration": duration,
                "format": audio_format,
                "transcription": transcription,
            }
        )

        # Remove the audio file from local storage
        os.remove(filename)

        return redirect(url_for("index"))

    transcriptions = collection.find()
    return render_template("index.html", transcriptions=transcriptions)


def transcribe_audio(file_path):
    client = speech.SpeechClient()

    with io.open(file_path, "rb") as audio_file:
        content = audio_file.read()

    audio = speech.RecognitionAudio(content=content)
    config = speech.RecognitionConfig(
        encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16,
        sample_rate_hertz=16000,
        language_code="en-US",
    )

    response = client.recognize(config=config, audio=audio)

    transcription = ""
    for result in response.results:
        transcription += result.alternatives[0].transcript

    return transcription


if __name__ == "__main__":
    app.run(debug=True)
```

Next, create a template called `index.html` inside a folder named `templates`.

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Audio Transcription</title>
</head>
<body>
    <h1>Upload an Audio File</h1>
    <form action="/" method="POST" enctype="multipart/form-data">
        <input type="file" name="file" accept="audio/*" required>
        <button type="submit">Upload and Transcribe</button>
    </form>

    <h2>Transcriptions</h2>
    <table>
        <thead>
            <tr>
                <th>File Name</th>
                <th>Duration (s)</th>
                <th>Format</th>
                <th>Transcription</th>
            </tr>
        </thead>
        <tbody>
            {% for transcription in transcriptions %}
                <tr>
                    <td>{{ transcription.filename }}</td>
                    <td>{{ transcription.duration }}</td>
                    <td>{{ transcription.format }}</td>
                    <td>{{ transcription.transcription }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</body>
</html>
```

Now, you can run the application using:

```bash
python app.py
```

Visit `http://127.0.0.1:5000/` in your browser to see the web application.

This code creates a Flask web application that allows users to upload audio files and displays their metadata along with the transcriptions. The Google Speech-to-Text API is used to transcribe the audio files, and the results are stored in a MongoDB database for future retrieval.