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
1answer
528 views

How to add spatial indexes through rockmongo

In rockmongo we got fields for the field name and whether we should sort by ascending or descending. How to add spatial indexes then?
4
votes
2answers
6k views

How can I time-stamp data in MongoDB?

I'm responsible for writing an app to juggle a huge amount of client and business intelligence information. This information involves records for various businesses and metrics like revenue, their web ...
4
votes
1answer
329 views

Ideal environment and cost for running a medium size MongoDb server

I know some people will say this question does not belong here but i didnt find a better place on the internet to ask this. Please migrate to an appropriate place if you think it should be. I am using ...
4
votes
1answer
604 views

MongoDB optimization on high data

I have a mongoDB collection with 42M registers with 1M new registers every day. We found a low performance on mongoDB querying. showing in mongostat the fields: qr|qw ar|aw with values of 300-500. ...
3
votes
1answer
950 views

MongoDB - handling embedded documents and relations

I am researching MongoDB for a web app that I am bulding. Coming from a MySQL background, the concept of embedded documents is not so easy to fully understand. Let's say I have a document called ...
0
votes
1answer
77 views

MongoDB: Can I perform a second query if the first doesn't match

When querying MongoDB is it possible to perform a query and if it isn't matched perform a second query. I could perform an $or which will do booth queries and return the results for booth but I only ...
1
vote
1answer
436 views

mongodb: replica-set processing reads on the primary

Running a replica-set with 1 primary and 2 secondaries, I wonder why the READs are also done on the primary. Shouldn't the primary mainly do the WRITEs and the secondary can share the READ-load?! I ...
1
vote
1answer
81 views

How can I automate sharding in the presence of continuous reads

I am using a pymongo in a sharded mongo environment. I have some fairly write-intensive systems, so I split the data up by time, with one database per hour, so the heavy-lifting of index-updates can ...
2
votes
1answer
3k views

mongodb: drop all collections

How to remove existing content before entering a replicaset the first time? mongodb worries about: ... has data already, cannot initiate set. All members except initiator must be empty.
3
votes
1answer
189 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 ...
7
votes
2answers
2k views

mongodb: replica-set with load balancer

Is there an option for load balancing with mongodb replica sets? I am not asking for a HAProxy or similar, but for a built-in feature from mongodb. Could not find tips for this in the docs.
1
vote
1answer
119 views

Storing all data in a single db versus multiple dbs in Mongodb

We have an app that is basically an ERP. Some of the resources in the ERP are satellite tracked. So the information related to the resource itself is minimal, but the satellite tracker produces data ...
0
votes
1answer
181 views

What database do most mobile start ups use? [closed]

mongodb? MySQL? PostgreSQL? If someone would add pluses and minus, let me know. Why I ask: I am a mobile startup. I need a database that supports spatial indexes. The spatial index must be able to ...
4
votes
2answers
860 views

MongoDB: Replica Set - master vs. slave

We think about moving from a master-slaves to mongodb with replica-set. Now I wonder if mongodb replicas are also set up like read-only slaves or if each mongos is able to write and sync the others ...
5
votes
1answer
324 views

MongoDB deployment best practices

I had a few questions around deployment best practices and how folks are using mongodb today. Feel free to add any other comments you can think off. No of databases per mongod instance. Is the ...
6
votes
2answers
4k views

MongoDB: RAM requirements

Is it enough to have the entire index in memory/ram or does mongodb even try to allocate as much ram as possible to store even the data for fast reads? I'd like to run mongodb + other applications ...
3
votes
1answer
551 views

MongoDB: queue vs. realtime write/update

On a large mongoDB I have 2 different use-cases for reading and 2 different types for write/update. read 1: find by index -> no question on this. this works like a charm - as long as the index fits ...
7
votes
3answers
3k views

Upstart script in ubuntu for mongodb

I am new to linux and mongodb. I've already installed mongodb on ubuntu but I want to run one more instance on different port. As I understood from other questions and forums , there must be upstart ...
6
votes
1answer
402 views

what is mongodb telling me when it logs an update?

After several minutes of a large program that pushes a lot of data into mongo, my log starts to show a message for (I guess) each update. This seems awfully noisy, is there some special reason it ...
3
votes
1answer
457 views

Could a large log file be the reason cron job keeps dying?

The log is 15 Gigabytes. I guess I have to back it up and delete. I have enough hard disc space, but did not realize log was so large. And overnight cron jobs suddenly started to die in the middle.
1
vote
1answer
124 views

Where do caching servers conceptually fit in my architecture?

Given the simple well-known architecture below: Where (conceptually) does the caching server(s) sit?
8
votes
2answers
2k views

MongoDB Replica Set SECONDARY Stuck in `ROLLBACK` State

During a recent automated update of our mongodb PRIMARY, when the PRIMARY stepped down it permanently went into a ROLLBACK state. After several hours in the ROLLBACK state, there was still no ...
-1
votes
2answers
255 views

MongoDB replication to one machine

Does MonogDB supports replication where I have many machines with MongoDB that have different data and I want to replicate this data to one, and only one MongoDB?
5
votes
1answer
1k views

Mongo Collection `Size` is *larger* than `storageSize`?

I recently compacted my collection using the command: db.<collectionName>.runCommand( "compact" ) And now my collection size seems to be bigger than size on disk! SECONDARY> ...
1
vote
1answer
78 views

Transfering data from one MongoDB server to another while eliminating users/authentication

I am transferring MongoDB databases from one server to another. The servers cannot talk to each other, so I must use mongodump/mongorestore. The 'from' server used authentication for the databases. ...
6
votes
1answer
1k views

What factors contribute to lock-percentage with MongoDB

We're attempting to better optimize how we're using our MongoDB instance. We seem to be routinely getting high lock-percentages, and are looking to help minimize that. Here is some mongostat output: ...
3
votes
1answer
117 views

MongoDB: Should I combine fields for performance in limited circumstances

I have a really simple MongoDB collection: { "user": 1, "domain": "example.com", "apiAccess": true } There's an index on the "user" and "domain" fields. I always perform the same type of ...
4
votes
1answer
368 views

MongoDB working set size on capped collection larger than capped collection size?

On my database server right now I have 16GB of ram and an 8GB capped collection with about 4GB of indexes. So I may understand this wrong but shouldn't this only ever use around 12GB of my RAM or ...
0
votes
1answer
140 views

The sort column must be the last column used in the index - MongoDB Indexing Advice

MongoDB docs advices that: The sort column must be the last column used in the index Here is the example: db.foo.ensureIndex({a: 1, b: 1, c: 1}) Good: find(a=1).sort(a) find(a=1).sort(b) ...
1
vote
1answer
373 views

collection partitioning in mongodb

Is there any semantic like table partitioning in MongoDB? My data is not that much that it would need sharding. but data is not important(but not completely useless) after several months.
3
votes
2answers
697 views

Import and Export database in Mongo just like MySQL

I am newbie to the Mongo.Before this I have worked only with MySQL.In MySQL we can import and export database easily.I want to know is there any option available in Mongo to import and export database ...
5
votes
1answer
342 views

How to store and query products the price of which depends on a complex set of conditions?

I haven't decided on a database. I have expirience with MySQl and I'm intrigued by MongoDB. Let the products be packages of cable tv providers: { name: "Virgin TV", price: 20 }, { name: ...
5
votes
2answers
4k views

How should I store time series in mongodb

I need to create a database of time series, and perform the following tasks: create new time series update existing time series query one or several time series at once (for instance all time series ...
4
votes
1answer
672 views

Design the big data with mongo db

I'm working now on the implementation of the following feature: Say I have a collection in mongodb with millions of entries (very big say 100M), each entry is of type {"uniqId", "properties"} for ...
4
votes
1answer
882 views

How to index dynamic attributes in MongoDB

I have following kind of data (simplified a bit from my real case) in MongoDB: { "name":"some name", "attrs":[ {"n":"subject","v":"Some subject"}, {"n":"description","v":"Some ...
10
votes
1answer
1k views

How do databases store index key values (on-disk) for variable length fields?

Context This question pertains to the low-level implementation details of indexes in both SQL and NoSQL database systems. Actual structure of the index (B+ tree, hash, SSTable, etc.) is irrelevant as ...
7
votes
1answer
779 views

Mongo Map-Reduce or Sharding?

So I asked this question: Setting up Mongo with clustering But I didn't know enough until I read the answers and did more research. Is it better to use Map-reduce or sharding for fast-paced ...
5
votes
3answers
1k views

Setting up Mongo with clustering

I'm going to start using Mongo as a database but I will not have it clustered at first. Can I use Mongo on a single machine, then later come back, cluster it and capitalize on the sharding? Or can I ...
4
votes
1answer
389 views

Would appreciate some suggestions on how I should model this data

I am setting up a website that will have users. Users can search for songs and (if signed in) save them to a playlist or their library of songs. I want it to be like iTunes in that all the songs on ...
3
votes
2answers
227 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 ...
11
votes
5answers
1k views

Infrastructure for Highly Concurrent, High Write DB

My requirements are: 3000 Connections 70-85% Write vs Read Currently, we are maxing out a High-CPU, Extra Large Instance at 700 connections. All 8 cores are maxed. We think it's the number of ...
9
votes
2answers
4k views

Difference between MongoDB's find and findone calls

I am working on a project and I am unsure if there is a difference between the way the find cursor works and the way the findOne cursor works. Is findOne just a wrapper for find().limit(1)? I was ...
3
votes
2answers
181 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 ...
5
votes
1answer
576 views

In MongoDB, is having lots of small collections better than having one huge collection?

Huge collections have huge indexes that may not fit into RAM. Is that problem entirely solved with sharding ? If I have lots of small collections with small indexes, what are the options for storing ...
10
votes
2answers
436 views

Is sharding effective for small collections?

It looks like database sharding is great if I have huge collections. What if I have lots of fairly sized collections ? Let's say that for 1 collection of 100 000 000 documents (not very big comments) ...
6
votes
2answers
294 views

Is there any way to efficiently perform the equivalent of DENSE_RANK in MongoDB?

SQL Server and Oracle both have DENSE_RANK functions. Is there a way to do something similar in MongoDB without having to resort to MapReduce? In other words, suppose you have a T-SQL select clause ...
10
votes
4answers
526 views

Good Resources on Operating/Administering MongoDB

What are the best resources for learning how to operate and administer MongoDB? There are plenty of resources on developing against it - which actually creates a problem when you've got plenty of ...
17
votes
2answers
1k views

CouchDB vs MongoDB [closed]

Evaluating document-oriented storage, what are the pros and cons of CouchDB vs MongoDB?