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

2
votes
2answers
21 views

How to find queries that timed out in MongoDB?

Is it possible to find queries in the system.profile-Collection of a MongoDB-database that did not finish due to a timeout? I found some queries that ran longer than the time specified in $maxTimeMS. ...
0
votes
1answer
252 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 ...
0
votes
1answer
263 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" : ...
2
votes
1answer
38 views

Secondary and Arbiter stuck in Startup

I'm using MongoDB version 3.0.0. I'm trying to setup mongodb replication on our machine. Replication was initially setup but due to some changes on the VM the entire thing crashed. When I tried to set ...
0
votes
0answers
662 views

show database command doesn't show databases [on hold]

I've made the following configuration options logpath=D:\mongodb\log\mongo.log logappend=true dbpath=D:\data\db directoryperdb=true port=64623 # [mo]ngodb maxConns=100 objcheck=true cpu=true # ...
0
votes
0answers
3 views

MongoDB WiredTiger compression stats

I'm using MongoDB 3.0.4 with WiredTiger storage engine. I was looking at collection stats and I'm seeking explanation on compression stats fields. What does "page written failed to compress" indicate? ...
2
votes
1answer
4k views

MongoVUE connect to mongodb with authencation failed! [on hold]

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 to genbank through this role by MongoVUE, but I ...
0
votes
1answer
125 views

Is there any relation between BSON storage for mongoDB and MySQL storage?

I am working on an application where I need to make analysis that what will be the storage size of BSON structure if same data is stored which is stored in MySQL. Basically I am comparing MongoDB and ...
0
votes
1answer
4k views

MongoDb slower then Oracle? [on hold]

I've imported 500k rows from an Oracle database to Mongodb to make some test. No indexes were added to the mongo collection. I ran a query which did one aggregation on a column and one filtering on ...
2
votes
1answer
221 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
23 views

mongodb is using most of disk space for journal and not cleaning itself

I am using mongodb on production with journal enabled. I am using mongodb to store application data and also using gridfs to store images. I am using Elastic Block Storage (EBS) with 10GB for each ...
1
vote
1answer
18 views

mongo DB The disk space completelly filled for replicate instance

I am currently facing a scenario that one of the replicate server disk got completely filled up, while our primary server still has additional space left. My confusion is that the cmd like ...
2
votes
1answer
16 views

mongorestore failure: error writing file “/var/lib/mongodb”

I want sync my server db with my local db; dump db mongodump --db [db name] copy dump folder into my local restore dump on my local mongorestore --db [db name] [dump folder path] I ...
1
vote
1answer
135 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
139 views

Is there any way to change the size of preallocate data file in mongodb?

In mongodb data files are preallocates to a particular size,like first data file .0, the next .1, etc. The first file mongod allocates is 64 megabytes, the next 128 megabytes, and so on, up to 2 ...
0
votes
1answer
432 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 ...
2
votes
1answer
153 views

Limit the RAM memory usage in MongoDB

I am using MongoDB-2.6.1. Is there any way to limit the RAM memory usage? For example: Out of 4 GB RAM, let MongoDB use till 3 GB (<= 3 GB).
0
votes
1answer
24 views

Data migration from SQL Server to MongoDb [closed]

I need to migrate some data from Sql server to MongoDb collections. Data structure could be not equivalent. I need to set custom mapping rules. Can you advice me a tool that is able to perform that ...
0
votes
1answer
9 views

How to get minimum value in pyMongo

I have a collection with several fields, and I'd like to get the minimum value from one. I know a command for getting the max value: collection.find_one(sort=[("myfield", -1)])["myfield"] but not ...
1
vote
1answer
304 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
124 views

MongoDB data directory space is increasing

I have a worry, mongoDB data directory space is increasing very rapidly: I have a two data files and each one has reached 2GB limit and starts spawning 2 GB file multiple files. Is there any where I ...
0
votes
1answer
105 views

Update an array element with inc mongo update

HI All I have this Data in mongo, {"articleId" : [ { "articleId" : "9514666", "articleCount" : 1 } ], "count" : NumberLong(1), ...
0
votes
0answers
16 views

Running out of disk space when removing documents error

I'm trying to remove unused document from a production instance of MongoDB but, when I try to execute this query: db.collection.remove( { date: {$lt: new Date((new Date())-1000*60*60*24*90)} } ) ...
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. ...
2
votes
0answers
29 views

Mongodb incremental backups

I was given the task to setup incremental backups for mongodb replicaset, as start point of course I googled about it and could not find anything on mongodb docs, I did find however this question ...
1
vote
0answers
14 views

MongoDB user account required for arbiter?

I have a test environment with two mongo v2.6.5 instances (#1, #2) and an arbiter instance in a replica set. I have a a common key file configured for all three instances. I have created an admin ...
1
vote
1answer
170 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
19 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. ...
1
vote
1answer
245 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 ...
3
votes
1answer
57 views

MongoDB: dbclient_rs replSetGetStatus failed{ ok: 0.0, errmsg: “unauthorized” }

When I'm using mongodump or mongorestore on a replica set these messages appear in the verbose output: dbclient_rs replSetGetStatus failed{ ok: 0.0, errmsg: "unauthorized" } The replica set is ...
0
votes
1answer
484 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
0answers
19 views

MongoDB create user readWriteAnyDatabase but without the ability to create new DB

I want to create a single user who can read and write to any existing DB, but wouldn't be able to create new DBs. I want to give that privilege only to the dbAdmin. I have tried to create a user with ...
0
votes
1answer
420 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: { ...
0
votes
1answer
27 views

Bypassing LDAP for MongoDb Users

Environment: MongoDb: 3.0 Enterprise Edition Linux: Red Hat Enterprise Linux Server release 6.4 (Santiago) Use case: We need to have the above three MongoDb users which are not present in LDAP ...
4
votes
2answers
439 views

check storage engine from shell

I'm upgrading to 3.0 and ran into some issues with the upgrade. Specifically, I got an error when trying to start up mongod via ssh, it tried to use the default dbpath instead of the one i specified ...
2
votes
2answers
49 views

Backup with mongoexport or mongodump?

For production backup, MongoDB recommends mongodump instead of mongoexport for accuracy of data. However, I would need to "scrub" data off a MongoDB database before backing it up. I am not aware of ...
0
votes
0answers
22 views

Mongodb exception in initAndListen

My MongoDB server was full so Mongod service could not start. There was a specific db that I didn't need, so I have deleted its file from the dbpath. Now when I try to start the service again I'm ...
0
votes
1answer
114 views

Choosing shard key with compound index field

I have a compound key with field articleId_1_host_1_timeStamp_1_isIndia_1_location_1. Cardinality of fields is articleId has 20000 different value host has 17 value timestamp is increasing field ...
2
votes
3answers
758 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 ...
1
vote
1answer
1k 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
0answers
13 views

Should mongodb be run in a service, or a worker cluster?

I'm trying to implement an architecture that's similar to the coreos's production architecture (shown below) Should I run the database as a central service or one or more of the workers? I figured ...
4
votes
1answer
126 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 ...
2
votes
1answer
314 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 ...
2
votes
1answer
204 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 ...
0
votes
1answer
2k 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 ...
1
vote
1answer
249 views

MongoDB can't add new replica set member [rsSync] SEVERE: Got signal: 6

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 ...
2
votes
1answer
2k 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 ...
0
votes
1answer
144 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 ...
0
votes
1answer
15 views

mongoDB: querying for a document that has an object reference

I have a widgets collection that has records like this: { "_id" : ObjectId("55a6abe193819c033d4d755a"), "name" : "widget1"} { "_id" : ObjectId("55a6abe193819c033d4d755a"), "name" : "widget2", "loc" : ...
1
vote
1answer
27 views

mongoDB design - to embed or not to embed

Let's say I have a mongoDB database with 3 collections: widgets thingomajiggers locations The way the application is going to be used that I will always force the user to specify a location ...