All versions of MongoDB - a scalable, high-performance, open source, document-oriented database.

learn more… | top users | synonyms

0
votes
1answer
7k views

Date range query for past 24 hour in Mongo shell

I am setting a cron job to collect results from MongoDB database profiler. I'd like to collect results within a 24 hrs period. I plan to run mongo command with javascript. Question is, in Mongo shell,...
1
vote
0answers
7 views

Replication prioroty

I have two MongoDB instances running on two servers (instance1 and instance2) and they are configured as a replica set. Instance1 is the primary and instance2 is the secondary. When instance1 was ...
0
votes
1answer
220 views

Client not reading from Mongo secondary database

I've implemented a replica set that I'm using globally. I have my master in Oregon, US and 4 secondaries. California and Virginia, Frankfurt and Sydney. I also have web servers in those same regions ...
0
votes
0answers
13 views

Design: Available domain database

I'm building website and service that will allow user to check if given domain is available. Right now I'm thinking about good way to store result from whois, but i dont want to store whole response ...
0
votes
0answers
12 views

MongoDB duplicate “_id ” for an array “_id”

Consider db "test" in my standalone mongodb instance. I created a collection called testCol and inserted a document with the following syntax : db.testCol.insert({_id:{"age":22,"empId":1},"DOJ":"...
0
votes
1answer
693 views

Long running query on replica worker set in mongo

Hi I updated my mongo version from 2.4.to 2.6. Now when i see current op in mongos it shows me some queries which are running for long long time. one example is { "opid" : "...
0
votes
0answers
14 views

MongoDB - multiple harddisk failure [on hold]

I have been running a MongoDB instance in a VM for the past three years. During the course, my server hard disk has failed 4 times and I have to replace it with a new one and restore the data. While ...
0
votes
1answer
8 views

getIndexes is not a function on mongo shell

I'm trying to get the index of a collection. > db.version() 3.2.6 > db.getCollectionNames() [ "last_aggregated_stat_ids", "mapps", "stats", "system.indexes" ] > db.mapps.getIndexes() [ ...
0
votes
1answer
162 views

Does remove document automatically remove the index that reference this document?

I am wondering if removing the document will automatically update the index if this document is referenced?
0
votes
1answer
224 views

How to setup sync between MongoDB and C# .NET Application

What is the best practice to synchronize a MongoDB remote database with a C# .NET App that would allow queries to be responded to within the local file system and update itself when there is a change ...
0
votes
1answer
500 views

Choosing shard key and friendly URL Ids for my MongoDB

I have decided to use MongoDB as my Database for a web application. However, I have some difficulties to get started and I hope that you can help me out with a few questions. I am developing my ...
0
votes
1answer
115 views

Error while doing in replicaset in windows (mongodb)

I tried doing the replicatset in windows, but im getting the below error. I checked the mongo process and killed the existing process. Even though the error exists. help me on this pls Thx ...
0
votes
1answer
95 views

MongoDB replication doesn't work using Java driver

I have a three instance replica set and i am using the following code to insert values in my mongodb database constantly. MongoClient client = new MongoClient(Arrays.asList( new ...
0
votes
1answer
118 views

MongoDB Tag-Aware Sharding Workflow

I wonder the work flow of sharding cluster in Tag-Aware Sharding. --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3, "minCompatibleVersion" : 3, "currentVersion" ...
-4
votes
0answers
38 views

Retrieving the data based on id from table contains 2 million rows [closed]

I have one table/collection contains 2 million rows/document (id(20 alphanumerical digits), name, ... etc). From that table I want to retrieve data based on the id within 1 sec Which database ...
5
votes
1answer
9k views

How restore a specific database from backup using mongorestore command

I created a backup of all my databases using mongodump command. Now I want to restore a specific database using mongorestore command. How is this possible, I use this command: --db option then ...
1
vote
0answers
45 views

Progress of mongodump operation jams at a random point

We are executing remote mongodumps to backup collections. For some time now sporadically one of these dumps stops to progress any further and remains to log out the same amount of documents processed ...
0
votes
0answers
16 views

MongoDB gets corrupted after docker container restart (WT_NOTFOUND)

Sometimes, with no particular explicit reason, MongoDB gives me this error: [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage ...
0
votes
0answers
14 views

Cannot connect to a mongos

I am implementing a sharded cluster in a Windows environment. I first create the config server as follows: C:\MongoDB\bin>mongod –configsvr –bind_ip 192.168.1.4 –port 3000 –dbpath C:\Sharding\...
1
vote
0answers
34 views

How to improve performance of this aggregate query?

I have the following tables in MongoDB: Users table (count 200+ users): { "_id" : ObjectId("56dd6204ce47a3c44d8b4567"), "u_role" : "1", "u_fname" : "dsfsd", "u_lname" : "dsfdsf", "u_email" : "dsfds@...
0
votes
1answer
123 views

mongo-express isn't listing my database

I have a setup with two databases, "admin" and "local". I'm using mongo-express with this config, but only seeing my admin database: 'use strict'; var url = require('url'); if (typeof process.env....
1
vote
2answers
671 views

Locked out of my own database through invariant() failure

I am trying to set up mongodb on my own server and connect to it remotely through my laptop. I had successfully installed the database and created my own user with admin privileges. However, when I ...
6
votes
2answers
3k views

Error parsing YAML config file: yaml-cpp

I'm using the following command (Windows machine) with the MongoDB shell version: 3.0.7: mongod --config "G:\NodeApps\mongod.cfg" --install Contents of mongod.cfg file are given below: systemLog: ...
0
votes
1answer
151 views

MongoDB won't start with access control turned on

Hello I would appreciate any suggestions, I have a 3 member MongoDB replica set setup on CentOS I'm trying to configure wit access control: node1, node2, arbiter, When I do not configure security ...
1
vote
1answer
108 views

Error 13141 in mongos shell while trying to write to a result of the mapReduce invocation to a sharded collection

In our db init script, we have the following lines: var conn = new Mongo(); var admin = conn.getDB("admin"); var db = conn.getDB("foodb"); admin.runCommand({ "enableSharding": "foodb" }); // ... db....
1
vote
1answer
121 views

MongoDB with Sharding has slow performance

I have the following setup for my MongoDB Sharded Cluster (everything is running on the same machine on localhost, just different port numbers): ConfigServers : 1 ReplicaSet consisting of 3 mongod ...
1
vote
1answer
1k views

WiredTiger - “too many open files error” during resync of a secondary replica set member

I'm upgrading a secondary replica set member to wiredTiger. I have upgraded it from MongoDB 2.6.3 to 3.0.4 and changed the storage engine to wiredTiger. Now it is resyncing all data from the primary. ...
0
votes
0answers
20 views

MongoDB or ElasticSearch

Which one of them is good to use? I'm developing a application which will have the following functionalities. Multiple users Each user will have their own database Data objects will be different; ...
0
votes
1answer
336 views

Data Analysis with MongoDB or MySQL

I have a need for processing some data in order to come up with some statistic. This is the scenario: Each user can answer several questions from the question list. They pick their answers from a ...
2
votes
1answer
205 views

cnames for mongo config server

I am seeing this line in many mongoDB links Use CNAMEs to identify your config servers to the cluster so that you can rename and renumber your config servers without downtime I need some help ...
0
votes
0answers
55 views

mongs failed to findone when collection is under sharding migration

I have a collection which enabled sharding on 2 replica sets, rs01 and rs02. I added a new replica set rs03, it started to migrating chunks to rs03 slowly(it only migrated about 300 chunks in 4 days......
0
votes
1answer
2k views

cannot log in to mongo from command line - using MongoDB 3.0 and WiredTiger - I've followed all instructions

NOTE: I have tried not setting bind_ip and also setting it to 0.0.0.0 -- neither one fixed my issue. This is my mongod.conf file: systemLog: destination: file path: "/root/mongodb.log" ...
0
votes
1answer
2k views

Issue while restarting - mongdb

I had tried to start the mongodb service using the following command in linux machine. service mongod restart I am getting the following error Stopping mongod: ...
1
vote
1answer
214 views

How to update a whole document in MongoDB using PHP?

I want to update my older entries through the PHP interface in MongoDB. First, I get data from the text fields and then store that into variables. Then I use those variables to update data in Mongodb. ...
0
votes
0answers
9 views

Mongodb, high disk write volume

On my developer machine (iMac) I was running mongodb locally and experienced high disk activity - 50-70MB/s writes. I found out the activity came from Mongodb, but I was not doing anything other than ...
0
votes
1answer
157 views

What are minimum configurations for mongodb replica set though a java program

I'm new to morphia. I'm using morphia and mongo-java-driver.jar to talk with replicaset(I need for cluster also) through a java program. I'm new to morphia. Wrote a sample program code is below ...
0
votes
0answers
20 views

Mongo DB services went down while creating indexes in >300GB Mongo database instance

While creating index for a collection in Mongo DB instance.Mongo DB services went down with below error. kindly help on how to overcome the same.For smaller database instances it went fine. Command ...
0
votes
0answers
27 views

Can one database affect the performance of another in MongoDB?

We have a fairly beefy server (15 GB RAM, 2 cores) running a reasonably large MongoDB instance. The Mongo instance hosts two separate databases that communicate via application code. The larger ...
0
votes
1answer
21 views

Standalone Backup and Restore Tools

We plan to have our build server perform a backup (mongodump) from our Production environment and restore it (mongorestore) to the Test environment for each new release to Test. Are there mongodump ...
0
votes
0answers
14 views

Migrating an active production sharded MongoDB 2.6 environment

We're currently considering migrating our live production MongoDB (2.6) environment (18 shards with replica sets, around 600GB of data, hosted service with very little user permissions) to a different ...
0
votes
1answer
13 views

What would be better long term: Creating many documents in MongoDB or fewer documents with nested arrays

I have a scenario I'm debating for my app. Let's say I have a Quiz application with a MongoDB structure that looks like this: { _id: xxxxxx, userId: xxxx, quizData: [ { name: xxxx, quizId: xxxx, ...
1
vote
1answer
120 views

Why does restarting MongoDB 3.0.x boost performance?

I have a MongoDB in my Development environment running on Windows, the server has 64GB of RAM, but MongoDB has only consumed 26.9GB (here we are building the database), so it should be able to hold ...
1
vote
1answer
137 views

Indexing a date field on MongoDB - best practice

Hi We would like to index a date field on a potentially large collection. Is indexing a date-time field a good practice? Or should we stick to a date field (e.g. 07/12/2017) indexing (both of the ...
0
votes
1answer
18 views

MongoDB cannot be started after moving the server

I had a happy MongoDB 3.0.5 installed on a VM on a Windows 2012R2 Server, for light use. I moved the VM to a new physical server without any major changes, and to my surprise it cannot be started; and ...
0
votes
1answer
27 views

MongoDB insertion in two collections or one to improve insertion speed

I have a collection, in which I have too many records (~300 million). And the insertion rate is also very high and it takes time to insert documents, which is my main problem. As I have two types of ...
1
vote
1answer
209 views

Selecting, filtering and aggregating in MongoDB

if we have two dataset 1-First dataset contains population data of cities in the United States of America. Each record in the dataset has the following format: { "city": "ACMAR", "loc": [ ...
0
votes
1answer
3k views

Storing multidimensional array in MongoDB

I am attempting to convert a large MySQL database of product information (dimensions, specifications, etc) to MongoDB for flexibility and to move away from the restriction of a column based table. I ...
0
votes
0answers
28 views

MongoDB avoid $sort + $limit optimization

In my Django app using mongoengine I've got such code: art_cursor = Articles.objects.aggregate({'$match': {'ntype': {'$in': [1,6]}}}, {'$group': {'_id': {'title': '$title'}}}, {'$sort': {'_id....
0
votes
0answers
14 views

MongoDB: migrate Replica set in a sharded cluster to new servers

I have sharded cluster with 4 shards (4 replica sets). I need to migrate one shard to a new set of servers. Can i Just add the new servers to the replica set and remove the old servers? Mongo version ...
1
vote
1answer
327 views

MongoDB: movechunk failed after adding a new share to cluster

I have a MongoDB cluster version 2.6.8, which already has two shares: share1 and share2. When I add a new share3 to the cluster, data chunk can't migrate to share3. This is from the mongos log: ...