mlab

MongoDB Cloud Deployment - High TTFB

落爺英雄遲暮 提交于 2021-02-18 18:51:50
问题 I am building a mobile only application in Node.js + MongoDB. I have deployed my server in the AWS AP-Southeast-1 Region . Since I am new to MongoDB, I am leveraging cloud hosting services like MongoLabs, Compose.IO, MongoDirector (testing a few out). Now, these cloud hosting platforms are deploying my database in either of the AWS AP-Southeast-2 OR US-East-1 Region due to unavailability of Shared hosting in the Southeast-1 Region. While testing my APIs, I saw a alarmingly high latency in the

MongoDB Cloud Deployment - High TTFB

风流意气都作罢 提交于 2021-02-18 18:51:36
问题 I am building a mobile only application in Node.js + MongoDB. I have deployed my server in the AWS AP-Southeast-1 Region . Since I am new to MongoDB, I am leveraging cloud hosting services like MongoLabs, Compose.IO, MongoDirector (testing a few out). Now, these cloud hosting platforms are deploying my database in either of the AWS AP-Southeast-2 OR US-East-1 Region due to unavailability of Shared hosting in the Southeast-1 Region. While testing my APIs, I saw a alarmingly high latency in the

MongoDB connection to MongoLab timing out in NodeJS on Heroku

霸气de小男生 提交于 2021-02-07 19:50:44
问题 At first everything works, and I can successfully store data by posting to the /upload route. But after 120 seconds of inactivity, the timeout event fires, and future attempts to store data fail. However the callback isn't called, so there is no "Unable to insert..." message at the log. var express = require('express'); var bodyParser = require('body-parser'); var winston = require('winston'); var config = require('./config'); var MongoClient = require('mongodb').MongoClient; var app =

MongoDB connection to MongoLab timing out in NodeJS on Heroku

独自空忆成欢 提交于 2021-02-07 19:47:29
问题 At first everything works, and I can successfully store data by posting to the /upload route. But after 120 seconds of inactivity, the timeout event fires, and future attempts to store data fail. However the callback isn't called, so there is no "Unable to insert..." message at the log. var express = require('express'); var bodyParser = require('body-parser'); var winston = require('winston'); var config = require('./config'); var MongoClient = require('mongodb').MongoClient; var app =

MongoDB - Java Driver performance

牧云@^-^@ 提交于 2021-02-07 18:30:09
问题 This is my environments. Java - 1.7 by Oracle mongod v2.4.5 (in Mongolab) I found difference in performance of the two MongoDB driver(2.9.3 vs 2.11.2) When I run same code using each driver, 2.11.2 slower than 2.9.3. for(int i=0; i<1000; i++){ BasicDBObject doc = new BasicDBObject( "currentTime", new SimpleDateFormat("HH:mm:ss:SSS").format(Calendar.getInstance().getTime()) ); coll.insert(doc); } DBCursor cursor = coll.find(); try{ while(cursor.hasNext()){ System.out.println(cursor.next()); }

MongoDB - strip non numeric characters in field

坚强是说给别人听的谎言 提交于 2020-05-11 06:11:08
问题 I have a field of phone numbers where a random variety of separators have been used, such as: 932-555-1515 951.555.1255 (952) 555-1414 I would like to go through each field that already exists and remove the non numeric characters. Is that possible? Whether or not it gets stored as an integer or as a string of numbers, I don't care either way. It will only be used for display purposes. 回答1: You'll have to iterate over all your docs in code and use a regex replace to clean up the strings. Here

MongoDB - strip non numeric characters in field

限于喜欢 提交于 2020-05-11 06:08:04
问题 I have a field of phone numbers where a random variety of separators have been used, such as: 932-555-1515 951.555.1255 (952) 555-1414 I would like to go through each field that already exists and remove the non numeric characters. Is that possible? Whether or not it gets stored as an integer or as a string of numbers, I don't care either way. It will only be used for display purposes. 回答1: You'll have to iterate over all your docs in code and use a regex replace to clean up the strings. Here

Connecting from AWS Lambda to MongoDB

我的梦境 提交于 2020-01-25 08:29:07
问题 I'm working on a NodeJS project and using pretty common AWS setup it seems. My ApiGateway receives call, triggers lambda A, then this lambda A triggers other lambdas, say B or C depending on params passed from ApiGateway. Lambda A needs to access MongoDB and to avoid hassle with running MongoDB myself I decided to use mLab. ATM Lambda A is accessing MongoDB using NodeJS driver. Now, not to start connection with every Lambda A execution I use connection pool, again, inside of Lambda A code,