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

learn more… | top users | synonyms

0
votes
0answers
42 views

Mongo Schema for large time series data sets

I'm not a DBA but a C# developer, my experience so far is with MS SQL, so please keep that in mind. I am trying to design a scheme to store sensor data and have it organized. Each TestRecord would ...
0
votes
1answer
62 views

mongodb compact does nothing - no entry in mongodb.log and nothing in db.currentOp()

We have space problems. The actual data size is only 5 GB, but disk size is 15 GB because of deleted documents. MongoDB (3.0.6) runs in docker container where we can't extend volume. # tail -f mongod....
0
votes
1answer
31 views

MongoDB ixscan seems to be scanning more objects than expected

I'm using MongoDB 2.6.12 and a collection has the following index {a: 1, d: -1}. In case the types matter a is a Number and d is a Timestamp. From what I can see in the code we are limiting this ...
0
votes
1answer
16 views

Delete document from nested array in mongodb

I've created a collection with following insert statement db.test.insert({ "_id": 1, "updatedAt": ISODate("2016-05-27T05:37:44.928Z"), "created_at": ISODate("2016-05-13T09:41:23.000Z"), "batchId": "...
1
vote
1answer
26 views

Security on MongoDB

I have been reading up on the security of MongoDB. If my web app lives on the same server as the DB, can I just set the bindIP to 127.0.0.1? I'm not sure what the best practices are, but this should ...
1
vote
0answers
26 views

Operational issue for scheduling mongodump as backup method

For production backup, MongoDB recommends mongodump instead of mongoexport for accuracy of data. However, a few operational issue remain unclear to me, appreciate if anyone can advise on this matter. ...
1
vote
1answer
37 views

Too many open connections with MongoDB 2.6 + PyMongo 2.7.2

I was running MongoDB 2.4 with a replica set which contains 1 primary, 1 secondary and an arbiter. We were using PyMongo 2.6 and MongoEngine 0.8.2. Recently, we performed an upgrade to MongoDB 2.6, ...
2
votes
2answers
171 views

Is findOne() in mongoDB deprecated

Is findOne() in MongoDB deprecated? I am asking this because when I use findOne() in WebStorm the IDE puts a line through findOne() and gives a message saying findOne() is deprecated and to find ...
0
votes
0answers
21 views

Mongodb - save image as bytes or as files

I'm developing a website which allows the user to upload an image per item. I guess there will be hundreds per user. What is more preferred? Save the images: as bytes in the DB (mongodb) as ...
3
votes
2answers
38 views

MongoDB not using all memory in Windows server

I have a stand-alone MongoDB instance running in windows. It's recently experiencing slowness and my troubleshooting has found the following symptoms. The slowness normally occurs after a full text ...
3
votes
0answers
43 views

How to assign 'findandmodify' privilege to a mongo user?

I'm running a Mongo 2.6 replica instance where a node application needs to talk to. Basically nothing much was setup except these parameters: # where to write logging data. systemLog: destination: ...
3
votes
1answer
122 views

replica set in MongoDB using docker, primary has error and stops being primary when another member is added to the set

I have two docker containers running a mongo instance each, they were initialized like this: docker run --name mongodb-shard-1-node-1 -d -v mongodb-shard-1-node-1:/data/db -p 27031:27017 mongo --...
1
vote
1answer
34 views

Syncing data from primary member to secondary after election

Maybe this is kind a stupid question but, I'm novice in configuring replication and I need to clear something before makeing anything else. Moment ago I configured replica set with 3 members in it. ...
0
votes
0answers
14 views

Ops Manager alert “Host is down” no info in mongodb.log, automation-agent logs and /var/log/messages

We received Host is down alert (Ops Manager - Alert - XXX - 2016-05-18T23:32+0200) I checked mongodb.log on all 3 replica set members. I see only logs about index creation, looks all healthy to me. ...
0
votes
2answers
31 views

MongoDB skipping 20 documents when storing in a variable

ids = db.students.find({}, { _id: 1 }); It gives the length of ids as 2993 while students count is 2413. It's not storing the 20 documents which are being displayed on the shell.
6
votes
2answers
203 views

MongoDB vs RDBMS DBA duties

What are the differences between the daily tasks/duties of a Mongo DBA compared to a RDBMS DBA? For example, some sites claim that a MongoDB DBA would not require to do data modelling or designing ...
1
vote
2answers
32 views

Redundant mirroring of two mongodb servers

I have built a laravel web application for a client of mine which runs on a dedicated server. The system is a booking system, and the client needs access to this at any time during the work day. So ...
1
vote
0answers
25 views

Mongo is slow when the IOPS reaches 50%

We have an AWS-r3.large system. With 1.5TB data volume dedicated to Mongo. We are still using 2.6.3 (yes, upgrade pending for a while now). The data size is only 550GB. The volume that we have, has ...
0
votes
1answer
54 views

MongoDB 'too many indexes' problem

I've got a problem, when I got 6 fields and have no subset of fields, which my app always uses. That means that all of my queries always have different set of fields to scan. Then I read a little old ...
0
votes
1answer
103 views

MongoDB query execution time

I'm using Locustio service as load testing tool for my app. Without details, I'm using the same aggregation query with simulated 100 users, in this case RPS (requests per second) is about 20. In first ...
1
vote
0answers
75 views

Why switch? [ReplicationExecutor] another primary seen with election time xxx:1 my election time is yyy:1

On 09-05-16 - 08:41:51 Replica Set elected a new primary. The question why? Here the logs from this time series and without login messages egrep -v 'NETWORK|ACCESS'. On the same OpenStack platform ...
0
votes
1answer
99 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
106 views

Memory usage of MongoDB

I've got Django app with mongoengine, which executes some aggregation-queries often enough. The main problem is that mongod takes all the RAM and then crashes, so no LRU working, mongod just trying ...
0
votes
0answers
66 views

Mongo crash after 2 seconds of starting

My mongod service crashes within 2-5 seconds of starting. I don't understand why. Here are the systemctl logs: systemctl status mongod.service mongod.service - High-performance, schema-free ...
1
vote
1answer
81 views

MongoDB cluster deployment

I am new to MongoDB. I am trying to deploy a MongoDB cluster. I am following: https://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/ I initiated Config Server Replica Set and after that I ...
0
votes
0answers
32 views

Mongodb database design

I'm planning to implement this schema in Mongodb, I have been doing some readings about schema design, and the notion was whenever you structure your data like a relational database you must be doing ...
2
votes
0answers
74 views

mongod crashes with “Invariant failure getExtent( a )->xprev.isNull()” message

I am trying to start a mongodb server with the database, that is located on portable drive. I know barely nothing about the internals of this particular database. There are 647 database.N files, 2G ...
1
vote
3answers
49 views

What is considered as a document in mongoDB?

I have been learning MongoDB for the past two days and I've been confused with documents and their limits, and how to overcome the limits. What is a difference between documents and collection?
0
votes
0answers
37 views

Cannot Start MongoDB

I cannot start MongoDB on Debian(Jessie 8.4 Stable). I generated the keyfile and added the path to the key file to the configuration and uncommented the "auth=true" but when I try to start the service ...
1
vote
1answer
42 views

MongoDB start ID and end ID

I want to insert bulk data into a MongoDB. Later on I want to find exactly the bulk I inserted. In MySQL I would have done: SELECT * FROM data WHERE id >= start_id AND id <= end_id How can ...
1
vote
1answer
35 views

how to get recordStats in mongodb 3.2?

I want to monitor accessNotInMemory of mongodb, before I can use db.adminCommand({'serverStatus': 1})['recordStats'] but according to mongodb doc, Changed in version 3.0: serverStatus no ...
0
votes
1answer
39 views

How to set a mongodb node to return as the primary of a replication set?

There is this question here: How to force a mongod to become primary in a replica set? But it was not the answer I was looking for. and there is the question below, which could be related but it is ...
1
vote
0answers
13 views

MongoDB: what is the better way to implement shared record with ability to remove it by each user

I have a MongoDB record, for example, called Letter. This letter can be sent to some group of users, so many users have an access to it. A Letter can be sent in a context of Topic that is shared ...
0
votes
1answer
47 views

MongoDB script to backup replication set locally to a ubuntu 14.04 server

I would like to make a Daily Backup of my MongoDB from a replication set running from ubuntu 14.04 server. End goal would be to get a daily backup and write the backup to a remote or local share - ...
0
votes
0answers
23 views

Data Modelling of product and product variations

I want to model product and product variations using mongodb (mongoose) I am really confused with how shall I model both I need to add stock and price to variations. Variation can be of anything (not ...
1
vote
1answer
39 views

Is there a way to find out if value exists with addToSet?

addToSet adds values to an array if the value doesn't exist. If the value already exists MongoDB will not return anything saying that it exsits. Is there a way to find out if the value exists? (...
1
vote
0answers
31 views

Solr with SQL Server or NoSQL

I am working on a POC of using Solr with SQL Server. I have a very complex data model with SQL server which required a bunch of joining and scalar functions to strip some mark up and other stuff. ...
1
vote
0answers
82 views

Getting empty folder when using mongodump to back up my MongoDB

Basically, I have a problem with using mongodump to back up my MongoDB. This is the general syntax I use in SSH: mongodump -d myDatabaseName -o ~/backups/my_backup This is the resulting message: ...
3
votes
1answer
98 views

Improving mongodb read throughput for tiny database

I am given to understand that MongoDB will essentially perform like it is pulling records from memory if the working set is small. I wrote a simple MongoDB test program that inserts just one record ...
0
votes
0answers
42 views

MongoDB collStats.size compared to collection.totalSize

I have a collection which has the following dimensions: rs0:PRIMARY> db.myCollection.totalSize() 2188206080 rs0:PRIMARY> db.myCollection.stats() { "size" : 5899660704, "avgObjSize" : ...
0
votes
1answer
44 views

Adding secondary via rs.add on MongoDB

I have a master and slave on linux (centOS 7). The rs.initiate(cfg) was done but its shows the below output when trying to add secondary via rs.add. I get this: How do I resolve? Version: The ...
0
votes
0answers
21 views

Speeding up MongoBD query { $ne: [] }

I'm currently doing a MongoDB aggregation but then have a query looking for all documents where a certain field, whose value is an array, is empty. obs = db.collection.count({'things.titles': {'$ne':...
0
votes
1answer
34 views

Is it possible which documents couldn't be dumped using “mongodump”?

I am removing historical data from a collection in MongoDB (3.2), but first I need a backup of it. The choice has fallen, a simple combination of: mongodump --db myDatabase --collection myCollection ...
0
votes
1answer
73 views

How to get mongdodump --quiet to still report errors?

I'd like to run mongodump so that it only outputs errors (to avoid extraneous logwatch reporting for an automated nightly backup script). I've tried mongodump --quiet but from a quick test this ...
0
votes
1answer
174 views

How to show all users of all databases in mongodb?

I know show users or db.getUsers() can show all users in current database in mongodb, but how to list all users in all databses for ease of management as an administrator?
1
vote
1answer
63 views

Large `mongodump` followed by `mongorestore`

I have a fairly large (~240GB) Mongo database that I need to transfer across a sluggish network and onto a new server. Traditionally for these situations, I've found that a mongodump followed by a ...
1
vote
1answer
29 views

Keep files in mongo as part of the data

I want to create a news app that works in the following way: The site will contain articles, and each article with have multiple versions. Each version is a docx file and the article itself does not ...
0
votes
2answers
574 views

mongodb could not find host matching read preference { mode: \“primary\” } for set?

I am deploy a monodb sharding, I have deploy a replica set in three machines: dev41:27017,dev42:27017,dev193:27017 and configsvr in three machine: dev41:27019,dev42:27019,dev193:27019 and also a ...
0
votes
0answers
25 views

Is that hybrid model i thought with Mongo and MySQL fits?

I'm building a System with Node.js-Express.js and at first i decided to use MongoDB to store. But a moment ago i read that article and it made me think about it. Article talks about a MongoDB exp. ...
0
votes
1answer
24 views

MongoDB temporary node / mirror

When I have a running MongoDB instance with some data and requests against it, can I start a second instance on another machine, register it as another node in the first instance and all the data is ...