```
Prompt:
How do I add a new product to the database?
```

- Copilot creates a new API POST /api/products for adding a new product to the database.

- This is not what I want. I just want to add 1 new product to the database once.

- I realize I don't need new code in my backend, I just need some code to run once to add something to my database. Therefore, I switch to Copilot Chat.

```
Prompt to Copilot Chat:
I have a product model in my code. Using
the product model, how do I add a new
product to the database?
```

- Copilot Chat responds with how to create a POST /api/products API, which is not what I want.

```
Prompt to Copilot Chat:
No I don't want to create a new API, I
just want to add a new product to the
database once.
```

- Copilot Chat correctly gives me a script that I can run to add to the database once. See the code changes below.

### Code Changes
https://github.com/SuperSimpleDev/ecommerce-backend-ai/pull/4/files

- Copilot gave me a very rough script for adding a product to the database. It used the Product model correctly, but several properties were missing / wrong.

- I manually filled in the properties of the product with a sample product, a tennis shoe, and gave it keywords `["apparel", "tennis shoes"]`

- I downloaded an image of a tennis shoe and put it in the images/ folder.

- I ran the script it created using `node scripts/addProduct.js`. This adds the product to the database once.

- I added the product to the defaultProducts array so if I reset the backend, my new product will be added automatically.

- I tested with Postman `?search=apprl` and `?search=tennis shoe`. It returned the tennis shoe.
