mongodb-atlas

Minikube/kubernets pod cant connect to Mongodb Atlas

℡╲_俬逩灬. 提交于 2020-06-17 09:06:42
问题 I have a Spring Boot application that I'm trying to test in Minkube, which should connect to MongoDb Atlas. It connects to my database when running the application on my pc, it also connects after creating and running as a Docker image, running on a Ubuntu VM on my PC. It does not connect to Mongodb Atlas when running as a Kubernetes deployment on Minikube. There must be a configuration step im missing, but i just dont know what. I think my question is "Do i need to do anything special to

Insert selective columns into collection using mongodb

南笙酒味 提交于 2020-06-16 17:24:30
问题 Wrote a trigger function that inserts full documents to my collection new_list when ever there is an insert into listingsAndReviews collection. exports = function(changeEvent) { const fullDocument = changeEvent.fullDocument; const collection = context.services.get('Cluster0').db("sample_airbnb").collection("new_list"); return collection.insertMany([fullDocument]) .then(result => { console.log(`Successfully inserted ${result.insertedIds.length} items!`); return result; }) .catch(err => console

Atlas MongoDB connection

て烟熏妆下的殇ゞ 提交于 2020-06-16 17:10:51
问题 I am trying to connect to Atlas MongoDB with the following URI (provided by mongodb connection string ) module.exports = { mongoURI:'mongodb+srv://<user>:<password>@cluster0-un6sk.mongodb.net/test? retryWrites=true' }; //connect to mongoose mongoose .connect(db) .then( ()=>console.log('mongoDB connected')) .catch(err => console.log(err)); I get the following error : { MongoNetworkError: connection 3 to cluster0-shard-00-00-un6sk.mongodb.net:27017 closed at TLSSocket.<anonymous> (C:\Users

MongoDB Charts – chart cumulative growth?

[亡魂溺海] 提交于 2020-05-15 18:49:11
问题 Using MongoDB Charts, how can I chart cumulative growth? Using the _id value of a document which contains the information of when it was created, I'd like to chart the number of documents in my database over time. E.g., if in July 10 documents were created, and in August another 10 were created, then the chart should display 10 for July and 20 for August. It's easy to bin document creation dates per months (see below example), but I'd like to turn this into a cumulative growth chart. MongoDB

MongoDB Charts – chart cumulative growth?

这一生的挚爱 提交于 2020-05-15 18:48:25
问题 Using MongoDB Charts, how can I chart cumulative growth? Using the _id value of a document which contains the information of when it was created, I'd like to chart the number of documents in my database over time. E.g., if in July 10 documents were created, and in August another 10 were created, then the chart should display 10 for July and 20 for August. It's easy to bin document creation dates per months (see below example), but I'd like to turn this into a cumulative growth chart. MongoDB

MongoDB Atlas error: invalid schema, expected mongodb

旧城冷巷雨未停 提交于 2020-04-18 06:06:53
问题 I am running through the Hello World app tutorial in GCP. And I am getting stuck at the server.js step. The code of the server.js is as below: 'use strict'; const mongodb = require('mongodb'); const http = require('http'); const nconf = require('nconf'); let uri = 'mongodb+srv://my_name:<mypassword>@mydatabase-clr75.gcp.mongodb.net/test?retryWrites=true&w=majority'; if (nconf.get('mongoDatabase')) { uri = `${uri}/${nconf.get('mongoDatabase')}`; } console.log(uri); mongodb.MongoClient.connect

Getting “Promise { <pending> }” error at “Log.save();” - Mongodb

和自甴很熟 提交于 2020-04-17 21:12:54
问题 I am following MongoDB Atlas Blog tutorial to add info into mongodb but I am getting the above mentioned error. I have tried to resolve this error, even tried to then but still getting the same issue... Following is my connection file async function main(){ /** * Connection URI. Update <username>, <password>, and <your-cluster-url> to reflect your cluster. * See https://docs.mongodb.com/ecosystem/drivers/node/ for more details */ const uri = "mongodb+srv://an:abc@abc-2yzxs.mongodb.net/test

io.sockets.emit() unable to send info From server side To client side

主宰稳场 提交于 2020-03-23 12:01:19
问题 I am fetching the chat history from db and displaying it to the user. The data is successfully reading data from the mongodb but whenever I'm using io.sockets.emit then client side is unable to receive any data.. Below is the server.js code io.sockets.on('connection',function(socket){ socket.on('getChatHistory',function(data,callback){ var query = { liveId: "1234" }; db.collection("chat").find(query).toArray(function(err, result) { if (err) throw err; console.log(result, " Result of Find

What is the differencce between MongoDB Atlas and MongoDB Atlas for AWS

流过昼夜 提交于 2020-02-25 05:21:09
问题 During my investigation on compatible DBs for IoT data storing I looked into MongoDB and pricing is a little bit confusing. Just wondering what is the difference between MongoDB Atlas and MongoDB Atlas for AWS as they both work on AWS? And what is the right way to run MongoDB Atlas on AWS? 回答1: As far as I can see, they both should mostly be similar : MongoDB Atlas : You can directly go to MongoDB-Atlas portal & create a MongoDB cluster(a cluster will usually be 3-shard/node replica set on

What is the differencce between MongoDB Atlas and MongoDB Atlas for AWS

六月ゝ 毕业季﹏ 提交于 2020-02-25 05:19:30
问题 During my investigation on compatible DBs for IoT data storing I looked into MongoDB and pricing is a little bit confusing. Just wondering what is the difference between MongoDB Atlas and MongoDB Atlas for AWS as they both work on AWS? And what is the right way to run MongoDB Atlas on AWS? 回答1: As far as I can see, they both should mostly be similar : MongoDB Atlas : You can directly go to MongoDB-Atlas portal & create a MongoDB cluster(a cluster will usually be 3-shard/node replica set on