MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms. Questions about programming should be asked on http://stackoverflow.com.

learn more… | top users | synonyms

0
votes
1answer
10 views

How to force a delayed member to become primary in case of failure in mongodb

I have three member set [primary,secondary & arbiter] in my data center 1 [DC1]. Now i want a delayed member in data center 2 [DR]. In case DC 1 is completely down then my sub net application ...
0
votes
1answer
197 views

users and roles in mongodb

Following users are created in mongodb. First user created with name "user" having read write role for "project" database use project db.createUser( { user: "user", pwd: "user123", ...
0
votes
1answer
20 views

Mongo primary is showing behind the primary?

Mongo primary is showing behind the primary ?? Its increasing as time passes . Please suggest ? monRepl:PRIMARY> rs.printSlaveReplicationInfo() source: xxxxxx:27017 syncedTo: Mon Apr 27 2015 ...
0
votes
1answer
230 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 ...
1
vote
1answer
386 views

How to setup a MongoDB replica set for the connector

I want to keep MongoDB and Solr in sync. The mongodb-connector (python) is the tool I want to use to do that. Now a replica set in mongodb is required (see ReadMe), but I don't want (and can) setup a ...
-1
votes
1answer
26 views

MongoDB denying API access, while console shell works

I am a MongoDB newbie, with a MongoDB instance running on a Ubuntu machine. If I login onto the machine's console and run mongo -u username -p password databasename I have permissions for the ...
1
vote
2answers
183 views

MongoDB does'nt starts after changing the data directory

I have installed a mongodb instance using yum..Now everything works fine.I started the service using service mongod start,it works good.Then i changed the data directory and log path in the ...
0
votes
0answers
38 views

Mongo Shard with Negative Average Size?

I'm seeing the following behavior from a shard in mongo: mongos> db.fs.chunks.getShardDistribution() Shard SH0 data : 740.29GiB docs : 5003098 chunks : 32949 estimated data per chunk : 23MiB ...
0
votes
2answers
415 views

Unable to start Mongodb. Appears to be crashed, if yes, how to recover my data

Below is the error when ouput when I am trying to start my local mongodb. I am unable to start it and after little exploration, I doubt my local db has been crashed. If yes, is there a way to recover ...
0
votes
1answer
266 views

MongoDB all replica set members are “OTHER”?

I am setting up a MongoDB replica set using EC2's image: https://aws.amazon.com/marketplace/pp/B00CO7AVMY/ref=dtl_recsim_B007IBMJPI_B00CO7AVMY_3 MongoDB version 2.6.5 I have managed to set up ...
0
votes
1answer
171 views

$addToset do not work in update if record not exists

I am trying to use following query db.TestColl.update({ "tags" : "silk" , "host" : "host.com"},{ "$set" : { "cat" : "MOVIE","publishTime" : 1370427540000 }, "$addToSet" : { "articleId" : { "$each" : ...
0
votes
1answer
385 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 ...
2
votes
1answer
138 views

mongoexport not exporting all possible data

I have a collection with documents similar to the following: { _id: 'p_123456', id: 123456, kind: 'person' data: [...] } id field can contain either positive or negative integers. This ...
0
votes
2answers
365 views

MongoDB/MySQL - auto increment vs object ID

I am in the process of evaluating MongoDB and writing some basic PHP applications around it. Typically in my PHP/MySQL applications, I would create an ID field and set it to auto-increment on each row ...
0
votes
0answers
18 views

Restart failed mongodb replica set instance under docker

I am trying to simulate when the master mongod instance shuts down for some reason in mongo replica set. So I took I docker file from here: ...
2
votes
1answer
181 views

Chunk Size is shown as 1 KB in mongo db logs even it is set to 300 MB

I am running a mongo cluster. Chunk size set is 300 MB but for today morning it is showing me in logs taht chunk size is 1024 Byte. I checked in current op there also it is showing chunks of 1024 ...
2
votes
1answer
125 views

Mongodb replica sets: why does my master server occupy more disk space than my slave?

I have two servers on my replica set. Let's call it the master and the slave, for the purpose of this discussion. The master was the original one, and the slave was replicated from that master. At ...
0
votes
1answer
334 views

How to update a field in sharded environment in mongodb using C# driver

I have successfully done loading in sharded environment. It is working fine. But when I do update in sharded environment, I am getting the error as : WriteConcern detected an error 'update { q: { ...
1
vote
1answer
3k views

MongoVUE connect to mongodb with authencation failed!

I had a mongodb ,and a database named genbank ,genbank has a user whose role is "read" and "readAnyDatabase",it is very strange that I cannot connect genbank through this role by MongoVUE ,but I can ...
1
vote
1answer
107 views

Limit the RAM memory usage in MongoDB

I am using MongoDB-2.6.1. The question from me is that- "Is there any way to limit the RAM memory usage??" Fr example: Out of 4 GB RAM, let MongoDB use till 3 GB (<= 3 GB). Please help me out.. ...
1
vote
1answer
27 views

MongoLab: Does hardware effect performance of a find() query [closed]

I asked a pervious question on StackOverflow about if document size affected the performance of fetching that document (the document is 3MB in size) ...
1
vote
2answers
127 views

Mongos version 3.0.1 Split Chunk Error with Sharding

I have 3 config server and two shards. Each shard has a primary, secondary and an arbiter. This is running with the following mongod settings: storageEngine=wiredTiger ...
0
votes
1answer
153 views

Mongo db sharded “the collection's metadata lock is taken” issue coming very frequently

I am seeing this warning in mongoS log consistently for one collection. [conn96] warning: splitChunk failed - cmd: { splitChunk: "ibeat20150105.dgrpCount", keyPattern: { articleId: 1, host: 1 }, min: ...
0
votes
1answer
341 views

MongoDB Replica Set Can't be connected To

I just set up a replica set for a standalone Mongo instance using the following changes to my config and rs.initiate(). # in master/slave replicated mongo databases, specify here whether # this is a ...
0
votes
1answer
111 views

mongodb on-premise: will it work? [closed]

We are planning to package MongoDB-PostgreSQL hybrid solution in our application that will be deployed on customer site on-premise. It will be packaged as a software virtual appliance. Our reason for ...
0
votes
2answers
84 views

Standalone MongoDB to MongoDB Shard Setup

I'm learning MongoDB currently so maybe the title of this question is worded poorly, but I'm looking to understand the scaling of Mongo better. I did some research on what DB would be best for my ...
1
vote
1answer
224 views

Mongo replication lag slowly increasing

I am running a replica-set in production with slaveOk = false using mongo 2.0.7 in AWS The replication lag on one of the servers is close to 58 hours. This replication lag is sometimes decreasing ( at ...
0
votes
0answers
15 views

MongoDB Backup & purge [duplicate]

I'm exploring solutions for a basic dbadmin need : periodically backing up and purging data in MongoDB. Basically, I need a logrotate for mongodb. I have a backend program filling a collection. I ...
0
votes
1answer
625 views

Can I copy a collection in mongoDB from one database to another by copying the db files directly?

I tried using cloneCollection http://docs.mongodb.org/manual/reference/command/cloneCollection/ , but clonecollection takes a lot of time in case of big collection because it starts indexing the data. ...
1
vote
1answer
217 views

Improve the insertion rate of mongo sharded cluster

I can't disable the write concern while i mongorestore with .bson file. It totally damages the insertion rate (insert/sec). This is my sharding status. mongos> sh.status() --- Sharding Status --- ...
1
vote
1answer
111 views

MongoDB Insert Performance

I have some data which are aggregated in chunks and later pushed into another collection. The problem is that aggregated data pushing to another collection is very slow and takes from few hours and i ...
1
vote
1answer
156 views

MongoDB installation Ubuntu 12.04 LTS errors

I need some help with my MongoDB installation on a clean, fresh Ubuntu 12.04 LTS server with no nonsense installed. I thought it would be a piece of cake, but I got some errors and the Ubuntu-forums ...
1
vote
1answer
1k views

mongodb replication node stuck at “STARTUP2” with optimeDate as 1970

i have just setup replica sets with three nodes . the third node is stuck at stateStr STARTUP2 with "optimeDate" : ISODate("1970-01-01T00:00:00Z"). However its showing no error message. Is this ...
1
vote
1answer
278 views

MongoDB text index and text search

I have a mongodb collection db.articles,it has 2 keys ,"title" and "abstract".I want to do text search on these two keys.For example, the search text is "physics",and I want all the documents whose ...
1
vote
1answer
112 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": [ ...
2
votes
1answer
1k views

verify that mongos server is connected to config servers

I've been writing a backup script for sharded replica-sets and it's almost done, except that I can't seem to get it to successfully start the balancer back up after everything's all said and done. ...
0
votes
0answers
20 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
172 views

MongoDB can't add new replica set member

I have a replica set, and I added a new member to the set. The initialSync begins for the new member and rs.status (on primary) shows STARTUP2 as status. However, after a long enough time, there's a ...
0
votes
1answer
134 views

Use index intersection feature in mongo 2.6 to compound shard key

I am having three indexes like name,age,salary. I can use them as compound index as per 2.6 (name and age together). But can i use the same indexes as compound shard key like name and age. i also have ...
3
votes
1answer
111 views

3 Node Replica Set all became SECONDARY

my 3 set replica set all became secondary and I'm not sure why. db1 2014-12-12T02:43:55.067+0000 [conn1413096] end connection 10.0.64.12:58483 (512 connections now open) 2014-12-12T02:43:55.067+0000 ...
0
votes
1answer
176 views

Failing to automatically re-connect to New PRIMARY after a replica set failover , from Mongoose (MongoDB, NodeJS Driver)

I made a simple NodeJS App, with Mongoose as MongoDB Driver. And connected to a mongodb replica set. The App is working fine until I shut down the current primary, When the PRIMARY is down, the ...
1
vote
0answers
20 views

Docker Mongodb replication on different hosts is not working

I am trying to setup a mongodb replication in Docker containers running on different hosts. Please find the steps below: In a VM1 running ubuntu 14.04, installed docker, then created container C1. ...
0
votes
1answer
1k 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
1answer
142 views

Data Migration or Sharded Cluster to new Cluster

We have Sharded Mongo Cluster. However some documents are sharded and others are unsharded. We are planning to migrate these databases to new cluster. Please update if there is any process or steps ...
0
votes
1answer
14 views

Running Aggregation logic on multiple shards of MongoDB

Suppose we have 5 shards in MongoDB having collection of data, and I have to write an Aggregation logic which should work on each of 5 shards in my cluster and collect data from these shards. Should ...
0
votes
1answer
307 views

Mongo Db server status with wired Tiger

I was testing my DB with Mongo 3.0 wiredTiger setup. After restoring my database with wiredTIger i ran db.serverStatus. I found following in console output. "bytes currently in the cache" : ...
0
votes
1answer
12 views

MongoDB 3.0 - how do I check which storage engine is being used? [duplicate]

I have MongoDB 3.0.0 running on a Digital Ocean droplet. How can I tell which storage engine it is using?
0
votes
1answer
26 views

Understanding MongoDB Aggregation

Pretend that our collection has 1M document Now if i do aggregation like this: db.users.aggregate({ $group: { _id : "$gender", avgAge : { $avg : "$age" } } }) then how it ...
0
votes
2answers
52 views

In mongodb, is “sh.getBalancerState() is false” the same as “sh.isBanlancerRunning is false”?

During upgrading config servers to use WiredTIger, I stopped balancer using sh.setBalancerState(false), and then I run sh.getBalancerState(). The output is false. Does this mean the balancer is not ...
0
votes
0answers
32 views

Best way to run an ETL on a production MongoDB database

We have the following environment: 3 servers + 3 replica set servers Each server has 3 shards Our main collection has around 40,000,000 documents that average at around 6kb Our shard key is ...