skip to Main Content

atlas .find returning empty array while local mongodb works fine

no errors console logs [] const mongoose = require('mongoose'); const uri = "mongodb+srv://:@cluster0.yhy4bwu.mongodb.net/?retryWrites=true&w=majority"; const playerSchema = new mongoose.Schema({ fullname: String, goals: Number, assists: Number, gamesPlayed: String, shots: Number, positionCode: String, plusminus: String, team: String, timeOnIcePerGame: Number, espnId: Number }) mongoose.connect(uri)…

VIEW QUESTION

Javascript – Add element to array if it exist

I have a nested Json Object payload={ abc:"abc", something:[somevalue:"somevalue",nestedAray:[{anotherValue:"anotherValue"},{optionalValue:"optionalValue",optionalValue1:"optionalValue1"}]] } here optionalValue1 key is optional in the payload. Need map the same JSON object to the new new Json with different Key names ecpected output: { name:"abc", skills:[Java:"somevalue","JSLibrary":[{JavaScript:"anotherValue"},{Angular:"optionalValue",NodeJs:"optionalValue1"}]] } I…

VIEW QUESTION
Back To Top
Search