This sample demonstrates integrating Mongoose with express
.
Make sure you have Node.js 14 or higher and a local Stargate instance running as described on the main page of this repo.
- Run
npm install
- Run
npm run seed
- Run
npm run build
to build the example - Run
npm start
- Visit
http://localhost:3000/review/find-by-vehicle?vehicleId=111111111111111111111111
to see the reviews for a vehicle. You should see the following JSON output:
{
"reviews": [
{
"_id": "6425a0ca8f330d09e7767e14",
"rating": 4,
"text": "When you live your life a quarter of a mile at a time, it ain't just about being fast. I needed a 10 second car, and this car delivers.",
"userId": "6425a0ca8f330d09e7767e0e",
"vehicleId": "111111111111111111111111",
"createdAt": "2023-03-30T14:46:34.451Z",
"updatedAt": "2023-03-30T14:46:34.451Z",
"__v": 0
}
]
}