skip to Main Content

MongoDB lookup in multi label nested array

I am very new in MongoDB. I am trying to make lookup in multi label nested array. My data is looks like bellow. [     {         "_id": "621eedae92979fd8f0e9451d",         "name": "Pallab Koley",         "shifts": {             "_id": "62636b9fcbda6d2b17f5cae0",            …

VIEW QUESTION

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

error states Unable to require(node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node) while npx performing prisma generate

I have a node.js project with prisma as ORM that connects to postgresdb. After I installed dependencies with yarn install I tried to run command npx prisma generate then I got error stating Unable to require(/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node) libssl.so.1.1: cannot open shared…

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 – 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