skip to Main Content

Select distinct combination of two fields with a condition in MongoDB (Node JS)

I have this kind of collection named 'Message' [ { _id: new ObjectId("62641aea1fbe19349f8fba78"), text: 'Hello', user: new ObjectId("625b8f00e2464fb758263b4d"), receiver: new ObjectId("62638d3e5bcd98e7e48ca1b7"), createdAt: 2022-04-23T15:27:38.270Z, updatedAt: 2022-04-23T15:27:38.270Z, __v: 0 }, { _id: new ObjectId("6264256fc0ee5093f8d994a0"), text: 'Hi', user: new ObjectId("62638f1495b841266161b032"), receiver: new ObjectId("62638d3e5bcd98e7e48ca1b7"),…

VIEW QUESTION

Mongodb – Express router is not working on mongoose. It is saying User is not defined

**App.js Code** const express = require("express"); const { default: mongoose } = require("mongoose"); const gaming = require("./routes/gaming"); const app = express(); app.use(express.json()); app.use("/", gaming); const dbConnect = mongoose.connect("mongodb://localhost:27017/Gaming"); const mySchema = new mongoose.Schema({ name: String, genre: String, games: String, })…

VIEW QUESTION

MongoDB Laravel works local but not on host

Would anyone know how to fix this I can't find any method that works online. My mongodb does work local but not on host. I'm using laravel with the following: "require": { "php": "^7.3|^8.0", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "jenssegers/mongodb": "^3.8",…

VIEW QUESTION

Mongodb – Github Actions Jest

My Jest tests are passing, but Github actions workflow isn't completing. Here's my main.yaml. name: Jest Unit Tests on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x, 16.x] mongodb-version: ['4.2',…

VIEW QUESTION
Back To Top
Search