MongoDB connection error getaddrinfo ENOTFOUND Cluster0_shard_name

I’m having an issue with trying to connect to MongoDB. I’m using mongoose here, console.log(“trying here”); // prints await mongoose.connect(db, { useNewUrlParser: true, useCreateIndex: true, useFindAndModify: false }); console.log(“Mongo DB connected”); // never reached And it throws an error getaddrinfo ENOTFOUND cluster0-shard-00-01-abcde.mongodb.net I have never had this error before, it used to work just fine…

Mongodb update with $concat and field missing

I wanted to update a collection to set a new Field with other inner field it looks like to generate a person’s full name . MongoDB Enterprise > db.name.find() { “_id” : ObjectId(“5d7ca743c45316e35251a49e”), “first” : “Don”, “middle” : “Jhon”, “last” : “Trump” } { “_id” : ObjectId(“5d7ca75bc45316e35251a49f”), “first” : “Dila”, “last” : “Tp” } {…

MongoDB $reduce(aggregation) group with the sum of the nested document in arrays and count by group

MongoDB Aggregation Framework Query: $group, $project, $addFields with $reduce. Use Case: I have the multiple documents with nested documents array in the collection, need a result group by and the sum of each group item as cumulative volume. Also, have match parameter on year(date), if year matches then only that year document should group by…

Find entities containing a sublist of elements from an embedded array in MongoDB with Spring Data MongoDB

I have a MongoDB entity that has a list of tags: @Document @TypeAlias(“project”) data class Project(@Id var id: String?, val name: String, val tags: MutableList<Tag>) I would like to look for Project’s containing a subset of the tags. For example given these proyects: projectService.save(Project(null, “someProject11”, mutableListOf(Tag(“area”,”IT”), Tag(“department”,”Architecture”)))) projectService.save(Project(null, “someProject12”, mutableListOf(Tag(“area”,”IT”), Tag(“department”,”HR”)))) If I define my…