Dockerizing NestJS APP and MongoDB “failed to connect to server [localhost:27017] on first connect”

I want dockerize my nestJS APP and MongoDB, but i receive this error : failed to connect to server [localhost:27017] on first connect Dockefile FROM node:10 WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD [“npm”, “run”, “start:prod”] docker-compose.yml: version: ‘3’ services: app: container_name: erpcore restart: always build: . ports:…

install MongoDB C++ Driver problem in ubuntu 16.04

I want to install MongoDB C++ Driver, so first is mongocxx I follow this installation: http://mongocxx.org/mongocxx-v3/installation/ but I can not pass step 4 when I run this in mongo-cxx-driver/build sudo cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. it shows — Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package): By not…

Unable to use agrregate operators in MongoDB(storageEngine=mmapv1)

I am getting following error while using $convert operator, mongodb storageEngine is mmapv1. db.persons.aggregate([{$project:{registred:{$convert:{input:”registered.age”,to:”double”}}}}]) db.persons.aggregate([{$project:{registred:{$convert:{input:”registered.age”,to:”double”}}}}]) Error: command failed: { “ok” : 0, “errmsg” : “invalid operator ‘$convert’”, “code” : 15999 }

Debezium mongodb kafka connector not producing some of records in topic as it is in mongodb

In my mongodb there i have this data mongo01:PRIMARY> db.col.find({“_id” : ObjectId(“5d8777f188fef5555b”)}) { “_id” : ObjectId(“5d8777f188fef5555b”), “attachments” : [ { “name” : “Je”, “src” : “https://google.co”, “type” : “image/png” } ], “tags” : [ 51, 52 ], “last_comment” : [ ], “hashtags” : [ “Je” ], “badges” : [ ], “feed_id” : “1”, “company_id” :…

How to implement twitter and facebook api like cursor based pagination in mongodb in nodejs using official mongodb client?

I am trying to implement pagination which should not show duplicate data in different pages on data insertion or deletion. Basic offset-based approach using skip and limit to paginate data is given on this How to implement pagination for mongodb in node.js using official mongodb client? Offset-based approach has a big flaw: if the results…

Using conditional lookup ‘from’ in mongodb / mongoose

Is it possible to use conditional lookup source(‘from’),in mongodb or mongoose like as follows Collection.aggregate([ { ‘$match’: { ‘receivers.user’: new ObjectId(‘……….’) } }, { ‘$lookup’: { ‘from’: $switch: { type: [ { case: 101, then: collection1 }, { case: 102, then: collection2 }, ] }, ‘localField’: ‘data.on_behalf’, ‘foreignField’: ‘_id’, ‘as’: ‘data.on_behalf’ } }, { ‘$unwind’:…

Why does the “distinct” and “count” commands happen so slowly on indexed items in MongoDB?

I am using MongoDB (Atlas) to hold my ~55 million time-series documents in a database The documents typically look like this: { “_id” : ObjectId(“5c8f1fb127fcc613f422677d”), “capture_time” : ISODate(“2019-03-18T04:33:51Z”), “key” : “9727eec91/51c922a.png”, “e_id” : 20702 } Not all documents have an ‘e_id’, so I have indexed “e_id” like so: { “v” : 2, “key” : {…

MongoDB aggregation framework to join by id two faceted collections

I have the following document (result of a $facet): { “productProperties”: [ { “productId”: “1” “productProperty”: “AAA” }, { “productId”: “2” “productProperty”: “BBB” }, { “productId”: “3” “productProperty”: “CCC” } ], “productRelations”: [ { “productId”: “1”, “relatedProducts”: [ { “productId”: “2”, “relationProperty”: 222 }, { “productId”: “3”, “relationProperty”: 333 } ] }, { “productId”: “2”,…