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

learn more… | top users | synonyms

4
votes
1answer
59 views

Should images be separated from posts in MongoDb?

I am working on a project with Meteor.js and I am using CollectionFS with GridFS to easily store images in MongoDb. Now I am not the best with databases and database design, but I heard that in nosql ...
0
votes
0answers
28 views

Index figures don't decline (even after compaction)

The scenario described bellow encountered both on 3.0.5 (on Amazon Linux) and 3.0.3 (Windows) machine using wiredTiger as a storage engine. I've inserted million documents to a collection with two ...
0
votes
1answer
49 views

Adding more space + bandwidth to a MongoDB cluster

I've read a lot about sharding and have gone through cluster setup process as well. What I can't get my head around is the actual database capacity after its sharded. So say for instance I have one ...
1
vote
0answers
97 views

mongodump monitoring (with exit codes)

This is how we monitor backups with mongodump. Exit code and mail if not 0. Mailing is reliable in our environment. mongodump -h $RANDOM_SECONDARY -u $BACKUP_USER -p $BACKUP_PASSWD --out /data/$...
3
votes
1answer
52 views

How do I know that I am connected to a config server

I need a simple check for identifying that I am connected to a MongoDB config server. I can check the process to differentiate between mongod and mongos: > db.serverStatus().process; mongod Now ...
3
votes
1answer
49 views

Is it dangerous to expose MongoDB's db.collection.find to users?

I know in SQL land people love referring to Little Bobby Tables as the main reason to have a very strict interface between your user base and your database. However, I want to implement a robust ...
0
votes
2answers
88 views

Document Store & Relational DB Hybrid. Exists? Possible?

Does anyone know of any product or open source project that attempts to strap together Mongo DB and MySQL for instance? I hear a lot about how relational DBs being ACID compliant makes it nearly ...
0
votes
0answers
60 views

In which order does a mongodump --query executes

In which order does a mongodump --query executes, is from last insert to first insert or the other way around, if it is other way around is there any option that I can pass to mongodump --query, so ...
0
votes
1answer
69 views

Do mongodb's 2dsphere index works on multidimensional coordinantes array?

if i create a index like that : db.createCollection("users") db.users.ensureIndex({coordinates:"2dsphere"}); and then insert a point var point = { type: "point", coordinates: [ 1, 2, 3, 4 ] ...
3
votes
1answer
137 views

Mongodb incremental oplog Dump not working

I am not able to take an incremental oplog dump. I am not getting any error messages the connection happens fine and also there is a operation recorded(shows up in db.currentOp()), but still nothing ...
0
votes
0answers
42 views

Deploy Existing MongoDB Replica Set with MongoDB Ops Manager

I'm trying to use Ops Manager to automate my current deployment. I installed all of the automation agents on every server, and then tried to deploy with Ops Manager. Ops manager detects all the ...
0
votes
2answers
70 views

Process to reclaim free space from mongodb ,replication is there

We are facing space pressure on production server so we are planning to reclaim space from prod instance.replication is there ,can anyone help me to know complete process in sequence to reclaim ...
0
votes
0answers
139 views

MongoDB. Data transfer error

Today I find a lot of following entries in mongos log 2016-01-04T09:08:16.086-0500 [Balancer] distributed lock 'balancer/lab-dl380-11:27117:1449663167:1804289383' acquired, ts : ...
2
votes
1answer
92 views

How to convert _id field of all existing documents from type String to Number

At one of my collections I have an _id field that stores numbers. The field was defined originally in the Mongoose model as String. However, all the data concerning this field in the collection ...
0
votes
2answers
103 views

How is it possible to convert a 3-node replica set to a 1-node replica set during low-usage hours

We have a chat application that runs on MongoDB. For the amount of users that we currently have, it is sufficient to have a 2 node+Arbiter set up during peak hours. However, during off-peak hours, we ...
0
votes
0answers
64 views

Why copydb command privilege not enough?

When copydb, mongo 2.6 gave the following error messages: mongos> use admin; switched to db admin mongos> db.runCommand({copydb:1, fromdb: "v_app1",todb:"v_app2",username:"hand_9",password:"abc"...
3
votes
1answer
35 views

Mongodb. Convert field to bool

I'm trying to change field type to bool among all documents in collection. Here is the code db.product.find().forEach(function(doc) { if (doc.checked === "Y") { doc.checked = true; } else if (doc....
0
votes
0answers
16 views

Manage clone of Production MongoDB on UAT env

I have mongodb (v2.4.9) replication setup on AWS ec2. I have one primary and 2 secondary for Production environment. The db size is around 80 GB and i am maintaining a snapshot of primary db server ...
0
votes
1answer
39 views

Shutting down mongod while mongodump is running

Can we shutdown mongod instance while the mongodump is running? Does mongodump operate by itself or it is a client for a mongod server?
0
votes
0answers
55 views

Backing up mongo database of about 120 GB size

We have a mongo database of about 120 GB size. I have run mongodump using nohup and redirecting the logs to /dev/null about 3 days back, but the dump file is ~40GB in size now, and the dump is still ...
0
votes
0answers
46 views

Cannot start mongod on rhel7

Servers crashes right after start From log: 2015-12-21T11:11:41.494-0500 SEVERE: Failed global initialization: UnknownError Could not add sasl auxprop plugin MongoDBInternalAuxprop: version mismatch ...
3
votes
2answers
181 views

MongoDB just utilizing one CPU core

Would anyone happen to know why Mongo is just using one core instead of distributing traffic on all? I am using the PyMongo driver and MongoDB is running on a centos server.
3
votes
1answer
94 views

Force a Member to Become Primary when Primary fails in mobgodb

I have mongodb 2.6.11 cluster of two members: nms02 and nms01m. I know how to force secondary to become primary when primary is avail. But now my primary nms02 failed..and nms01m is secondary...How I ...
2
votes
1answer
41 views

How to make most of aws?

I'm new to aws (just one day old). I'm impressed with aws free tier and want to utilize to its best. As of now I'm done with installing mongodb on aws micro instances and mongod EC2 instances are ...
6
votes
2answers
174 views

Force a Member to Become Primary in mongodb

I looked into answers but nothing works for me in mongo 2.6.11 cluster 'nms' (members nms01m and nms02) below. I want my current secondary nms01m to become primary, and now nms02 is primary instead of ...
2
votes
1answer
38 views

How to design mongodb collection? [closed]

We have a service will collect data and call api to save to a mongodb's collection name alldata And the problem is ,it keeps write data frequently,then the mongo will shutdown (I found on ...
1
vote
0answers
35 views

Performance issue when querying items inside circles

I need to query 300 items among 100,000+ and all of these 300 must be contained inside a set of many circles (hundreds). I am using a MongoDB database and here is a part of my logs: "command": "{ ...
2
votes
1answer
43 views

Mongodb group by queries

Lets say one of my items in a collection looks like that: { User:123 Grade : 100 } I want to sum up the grades for each student so i have this output: 123: 100, 445: 30 etc Im normal sql, its ...
3
votes
2answers
260 views

Deciding EC2 Instance type & Volume IOPS for Mongo DB

We have 500GB data in our Mongo(v2.6.3) including the indexes. We currently run this on AWS m3.large(8GB RAM) instance. Yes, Single machine. Our MongoDB Cloud Manager shows these stats: ...
4
votes
1answer
460 views

Mongo replica set with no PRIMARY/SECONDARY, members are STARTUP2 and RECOVERING

I have a mongo cluster with 6 replica sets. 5 are fine, one is not. Each replica set has three members. Here is the rs.status() for it: { "set" : "rs_5", "date" : ISODate("2015-12-16T02:37:...
4
votes
1answer
151 views

Drop/Create MongoDB TTL index vs. collMod in production

I'm working with a MongoDB collection containing over 250 million documents that has an existing TTL index and is written to with a pretty high frequency. I'd like to reduce the TTL value for the ...
4
votes
1answer
60 views

Mongodb get Effective Lock

I´m trying to calculate the Effective Lock %, like MMS does. I think I could get it via MMS API, but most of our mongo instances currently are not monitored in MMS (and probably never will). All I ...
0
votes
1answer
601 views

MongoDB - Don't know what to do with file

Windows 10 and MongoDB 3.2 I have 2 files. One with .ns extension and one with. They are both in c:\data\dump I am trying to run mongorestore -d gnome c:\data\dump However all I get is 2015-12-...
1
vote
1answer
25 views

Index selection in MongoDB 3.0 for $or query

I have a big $or query and MongoDB is not picking the index that I expect it to. Query: {"$or" : [ {"del_at" : {"$gt" : Timestamp(1448895834, 2)}}, {"rts" : {"$elemMatch" : {"k" : "app","v" ...
0
votes
0answers
85 views

REST API/ HTTP Interface Mongo not working : Only shows text “It looks like you are trying to access MongoDB over HTTP on the native driver port.”

I have below mentioned snippet in my mongod.cfgfile. net: port: 31002 http: enabled: true JSONPEnabled: true RESTInterfaceEnabled: true When I ...
1
vote
0answers
123 views

admin user creation is giving error in mongodb 3.0

I am trying to create admin user in mongoDB and it's giving me following error. MongoDB 3.0 version is being used. Error : 2015-12-10T15:23:47.065+0000 E QUERY Error: couldn't add user: Could not ...
2
votes
1answer
127 views

Mongodb Bulk find and remove is taking long time

I'm just making my hands dirty(handson) with MongoDB. First I did bulk insert of 1 million documents. // Bulk insert query var bulk = db.bulktest.initializeUnorderedBulkOp(); for(var i=0;i<1000000;...
2
votes
0answers
103 views

MongoDB Replica Set CPU load [closed]

I am running a fairly standard MongoDB (3.0.5) replica set with 1 primary and 2 secondaries. My PHP application's read preference is primary, so no reads take place on the secondaries - they are only ...
3
votes
1answer
29 views

MongoDB Storage size scaling

I have a Java + MongoDB web application deployed on an OpenShift production medium gear, with no scaling enabled, with 11GB storage. At the moment, I have some data stored, so MongoDB accurately ...
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 ...
2
votes
1answer
114 views

mongodb bulk write all or nothing?

I am learning about mongodb. If I create a bulk write is this transaction all or nothing? I have a scenario where my users can delete who they are following. For this to happen I need to delete from ...
1
vote
0answers
39 views

How to use DBRefs to fetch records from multiple collections in MongoDB

I am working on a database for library system. I have a collection called 'books' and another collection called 'publishers'. This is my documents structure in collection 'book'. { "_id" : 1....
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
71 views

In mongodb 3.0 replication, how elections happen when a secondary goes down

Situation: I have a MongoDB replication set over two computers. One computer is a server that holds the primary node and the arbiter. This server is a live server and is always on. It's local IP ...
2
votes
0answers
1k views

Multiple IPs are not getting bind in mongodb conf file

I am trying to bind multiple IP to mongodb config file, one is 0.0.0.0 and other is 127.0.0.1. I did the following change in configuration file /etc/mongod.conf # network interfaces net: port: ...
0
votes
1answer
135 views

mongo2.6: db.serverStatus().connections nothing happened?

I wanted to create a user,and got authorize error. So I modify the /etc/mongod.conf : #auth=True And then restart the mongo,and create the user on terminal : use admin db.createUser( { ...
0
votes
0answers
39 views

MongoDB replicaset config info differs among replica members

I have a replicaset running in MongoDB3.0. I did some changes to the replicaset configuration a period after the initial setup. For some reason, I have different replicaset config information in ...
1
vote
1answer
2k views

db.serverStatus() got not authorized on admin to execute command

My mongo version : 2.6.11 I want to check db.serverStatus() in my robomomgo But got errmsg: { "ok" : 0, "errmsg" : "not authorized on admin to execute command { serverStatus: 1.0 }", "...
0
votes
2answers
130 views

i need clarifications on MongoDB

I have a few questions, hoping I can get answers. what does it mean when the Mongodb said: Clients can read documents while write operations are in progress I can see partially updated ...
0
votes
1answer
36 views

MongoDB storage of multi-dimensional arrays

Using MongoDB 3.0.7 as the primary datastore. I connect to it using ReactiveMongo 0.11 on a JVM-based language. My question is: how well does Mongo store multi-dimensional arrays? For image analysis, ...