Skip to content

dantecalderon/nestjs-mongoose-ids

Repository files navigation

Mongoose sample

Test Data

POST https://localhost:3000/cats

Body:

{
  "name": "Bob",
  "age": "1",
  "breed": "Persian",
  "favFoods": [
    {
      "name": "chicken"
    },
    {
      "name": "Cookies"
    }
  ]
}

Behaviour(created the objectId and _id field):

Installation

npm install

Running

This example requires docker or a local mongodb installation. If using a local mongodb, see app.module.ts for connection options, and make sure there are matching options for the mongodb installation and the source code.

Docker

There is a docker-compose.yml file for starting Docker.

docker-compose up

After running the sample, you can stop the Docker container with

docker-compose down

Run the sample

Then, run Nest as usual:

npm run start

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published