Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
3
votes
2answers
6k views

MongoDB - how to reduce numYields

I have a MongoDB database with ~100GB data size. I ran a test with 300 threads and queries are all reads, no writes (except writes to db profiler I guess). I enabled database profiler to keep track of ...
3
votes
1answer
5k views

Mongo large chunks will not split

I had a 3 shard set up, and ran out of capacity, so I added 3 more shards. (Each shard is a replica set). But the data isn't spread across the cluster evenly. I have my chunkSize set to the standard ...
3
votes
1answer
134 views

Are operators also considered to be keys?

I'm taking a MongoDB course and one of the assignments asks to include quotes around keys. So I did for a query like this {$push: {"key":value}} But I was told that $push is also a key because it's ...
3
votes
1answer
11k 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 }", "...
3
votes
1answer
14k views

MongoDB update object in Array

I have the following document: { "name" : "student_1", "courses" : [ { "name" : "Algebra", "grades" : [ 98, 96, 92 ] }, { "name" : "...
3
votes
1answer
2k views

Disable TTL thread in MongoDB

Is there any way to disable TTL deletion thread in mongoDB? I know that you can modify the ttl index expireAfterSeconds value to a high number in order to "technically" stop ttl from deleting, but i ...
3
votes
1answer
3k views

How to check my MongoDB throughput and perfomance limit?

How can I check how many queries per second my MongoDB is executing and whether it had reached the performance limit or not?
3
votes
1answer
517 views

Where to store data on AWS?

I'm using AWS to host my application, and I'm using mongodb as db. I have installed mongodb on amazon ec2, but now I have no idea about where I should store all of my data. Can I store all of my data ...
3
votes
1answer
16k 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" : ...
3
votes
3answers
13k views

How do I explicitly define data types for a MongoDB collection?

How do I explicitly define data types for a MongoDB collection? I understand that in Mongo if a collection doesn't exist it will create it when you insert the document, but I know the fields and data ...
3
votes
2answers
591 views

Scalability: Desiging a message table

This question might be deadly simple but I wanted to make sure I am going through the correct path and not making any simple and irrevertible mistakes. My project will be based on messaging and it ...
3
votes
1answer
7k views

What does reslen and other means in mongodb log?

database.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.772835, -6.186753 ], $maxDistance: 0.04498373205078301 }, Prominent: { $gte: 15 }, indexContents: { $all: [ /^aru/, /^op/ ] } } ...
3
votes
1answer
2k views

Mongo Super User won't connect to another database other than admin

Why is that? $ mongo admin -u admin -p password --host 192.168.99.100 MongoDB shell version: 3.2.9 connecting to: 192.168.99.100:27017/admin > show users { "_id" : "admin.admin", "user" : "...
3
votes
1answer
8k 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 ...
3
votes
1answer
5k views

How unique are MongoDB _id fields?

I am trying to create a schema for documents and collections for a MongoDB database I am creating. I have read a few documents describing the _id field that is generated by each document upon creation....
3
votes
1answer
2k views

How do long string field names affect MongoDB database size?

I am using MongoDB and the names of my fields are strings with 10-20 characters. A typical document consists of 30.000 columns filled mostly with floats, like 1.2, 10.5, 2.55. It's size is 1MB. Do ...
3
votes
1answer
4k views

Query MongoDB Collection Compression Settings?

How can i query the settings for collection compression in MongoDB? I configured WiredTiger as storage engine and as collection compression the zlib algorithm. Here is a snippet of my configuration ...
3
votes
1answer
5k views

executing shell (bash) commands from within the mongo client

How can I execute shell (bash) commands from within the MongoDB client? With MySQL client: system (!) Execute a system shell command. Is there something similar for MongoDB?
3
votes
1answer
9k views

Mongodb update conditional set operator ($set only when it is insert )

Is there anything in Mongo update where $set when will work only when an insert is done. example is I have a collection which has these fields: Username FirstOccurrence Count What i want that i ...
3
votes
3answers
3k views

Why does mongodb require three config servers

The official mongodb documentation states to use three config servers. They say its for redudancy, because 1 server would be a point of failure.... but why not 2? in a production sharded cluster, if I ...
3
votes
2answers
626 views

Does MongoDB auto compacting

I copy a collection to another collection. Data is 14GB. I deleted the copied collection. Yet the size of the directory is still 14 GB. I chose repair but it seems to take forever. Actually inserting ...
3
votes
2answers
559 views

How to check the pre-allocated database file of MongoDB is Used or not?

We have been using MongoDB for a few weeks. One thing we could not understood is Pre-allocated file. Is there any way to check whether the pre-allocated file is currently used by MongoDB or not? We ...
3
votes
1answer
6k views

MongoDB Maxing CPU Usage

I have a weird one here. We have set up our production MongoDB which was populated by our test one so we had something to work off of. As soon as we started the service we hit instant 100% CPU load ...
3
votes
1answer
83 views

Does it make sense to limit Mongo RAM?

I have a Windows server running MongoDB. My database has big indexes and all RAM is usually busy. As I know, it can be a cause of Windows swapping and performance issues. Does it make sense to limit ...
3
votes
2answers
4k 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. ...
3
votes
1answer
8k 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 ...
3
votes
1answer
1k views

how to make secondary slave as readable in MongoDB?

How do I make a secondary slave as readable in MongoDB? We can do this via shell command rs.slaveOk() But how we can do it permanently for all session via config file?
3
votes
1answer
194 views

Setup MongoDB replica servers with different power?

Is it a good practice to setup replicas with the same machine size (wrt. CPUs, RAM, Bandwidth, etc.) or can replicas be based on smaller machines? One usecase might be to have a small non-voting ...
3
votes
1answer
4k views

errno 98 but no other mongod running

Here are my config options: options: { config: "/etc/mongod.conf" , net: { bindIp: "127.0.0.1, 10.0.2.57" } , processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" } , storage: {...
3
votes
2answers
10k views

How to activate shard balancer in sharded MongoDB

I have a very simple MongoDB database structure. Also I have 5 shards in it (3 of them are replicasets). But we are testing DB loading and it seems that shard balancing isn't currently enabled. On ...
3
votes
2answers
1k views

Is it safe to remove an entry in a “config.mongos” MongoDB collection?

There are old entries in my "config.mongos"; they reference hosts which previously had "mongos" running on them but no longer do. Can I safely remove those entries? e.g.,: # Old entries { "_id" : "...
3
votes
2answers
193 views

What are the best Database Analytics Companies for analyzing several 1000s or Mio. of products,sum them together and analyze them for statistics?

We will get several thousands products in our database. The problem is that one product can have several different names e.g. "iPad 16GByte UMTS schwarz" or "iPad 16GB 3G black" and so on. But they ...
3
votes
1answer
637 views

MongoDB: is order guaranteed deep into the aggregation pipeline?

I'm trying to get the "top" 2 items for any number of foreign keys, sorted by some key. What I have is the following, which appears to work: db.getCollection('col1').aggregate([ {$match: {fk: {$...
3
votes
1answer
2k views

How to match a WiredTiger index file to its corresponding collection

I have a mongodb database with about 2 billion records, shared between 20 or so collections. Each of these collections has an index on it, based on a single key (other than _id). I have an index file ...
3
votes
2answers
2k views

what is an Assert in Database world?

I searched for Assert and found general explanations: Assertion (software development) In computer programming, an assertion is a statement that a predicate (Boolean-valued function, a true–...
3
votes
1answer
599 views

MongoDB Restore / Snapshot Schedule - Point In Time vs. Oplog Timestamp

in docs Restore a Replica Set from a Backup those restore points are available: Snapshot Point In Time Oplog Timestamp What's the differences between those restore points? I guess Snapshot is fast ...
3
votes
2answers
2k views

MongoDB replica set node failure without arbiter

I'm baffled by the fact that this isn't addressed in the official docs (or at my inability to track it down). From the 3.4 docs: Only add an arbiter to sets with even numbers of voting members. If ...
3
votes
1answer
1k views

MongoDB: Index intersection does not eliminate the need for creating compound indexes

This is a quote from the MongoDB docs: https://docs.mongodb.com/v3.0/core/index-intersection/#index-intersection-and-compound-indexes But it doesn't explain why it doesn't eliminate the need for ...
3
votes
1answer
112 views

MongoDB mongos router and microservices architecture

Any mongos process in your infrastructure can perform chunks migration while they hold the lock. In a microservice architecture, processes are started and stopped more dynamically, i'm thinking for ...
3
votes
1answer
169 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
3k 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 ...
3
votes
1answer
2k views

mongo converting standalone to replica set causes services down

I have standalone node1 already running for a long time. Now I want to convert it to replica set. I followed steps in https://docs.mongodb.org/v2.4/tutorial/convert-standalone-to-replica-set/ to ...
3
votes
1answer
2k views

Mongo Scaling - Too Many Connections - Linear Horizontal Scaling with 100s of App Servers

I have a Mongo Cluster. It's sharded on 6 servers, with 6 replica sets, each replica set having one Primary, and two Secondaries. Additionally, there are 3 config servers. Though, I think the Mongo ...
3
votes
1answer
11k views

What's the procedure to set up username/password on mongodb?

I have tried setting up username / password .But none of the methods seems to work. 1. In mongod.conf ----> remove **#auth=true** to **auth =true** 2.Started the mongod server --> sudo service ...
3
votes
1answer
10k views

Searching for array elements nested in MongoDB Documents

I need to store card documents in my database. Cards need to be stored with a set of integers that represent the bundle, box and pallet, or whatever other entity they belong to. The packaging ...
3
votes
1answer
2k views

MongoDB ReplicaSet reconfig when primary and majority don't exist

http://docs.mongodb.org/manual/tutorial/reconfigure-replica-set-with-unavailable-members/ Is there anyway to reconfigure a replica set in the event the primary as well as a majority of the servers ...
3
votes
1answer
3k views

mongodb: maxTimeMS ignored

After trying with different drivers and clients, we suffer with mongodb timeout on find query. Even Profiling logs the settings and issue well. 2014-08-13T23:46:43.218+0200 [conn80] query ...
3
votes
1answer
8k views

MongoDB insert performance rapidly dropping

I'm currently experiencing a rapid decrease of the insert Performance. I have a rather simple data model { "Id": "ObjectId", "SomeProp": "xy", "SomeTags": [ { "key": "...
3
votes
1answer
375 views

Accessing unsharded database in a MongoDB shard cluster without going through mongos?

As far as I can understand, not all databases in a MongoDB shard cluster have to be sharded; I can keep some databases unsharded, on only one of the shards. So suppose I have a shard cluster, with ...
3
votes
1answer
424 views

Does mongodb automatically move small non-partitoned databases to spread read load?

I have a few hundred small databases, each between 0.2GB and 4.0GB in size. These are sitting on a sharded mongodb environment with 10 or so shards. At any one time, only a very small subset of these ...

1 3 4 5 6 7 41