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

0
votes
1answer
48 views

How to save mongodb data sub data more properly in this case?

I have a business collection. The businesses are reviewed by users. Each user can only review a business once. Future reviews will simply replace the former one. This is how we store it: ...
7
votes
1answer
2k views

MongoDB Not Using All Available RAM

I have something around 200 GB worth data stored in a mongo cluster. The physical memory on one of the instances which runs mongo is 8GB. Nothing else of any consequence runs on this instance. As near ...
1
vote
2answers
315 views

Mongodb multikey index and $all in queries

I have such structure of documents in my products collection: { title: 'Samsung Galaxy S III', category_id: ObjectId("50bcc2f0b910a6c1936a4424"), properties: [ { title: 'OS', ...
1
vote
1answer
62 views

Sharded Mongodb Communication

I would like to know what ports I need have open for a sharded mongodb cluster. For example does the mongos need to be able to accapt connections to and from mongoc. I dont want to have to many open ...
3
votes
1answer
2k views

MongoDB: What does '[DataFileSync] flushing mmaps took … ms for … files' mean?

I am building an index in MongoDB for a large collections (~300GB) and the db terminal window keeps printing: [DataFileSync] flushing mmaps took 10920ms for 151 files The time that it takes to ...
1
vote
1answer
262 views

Books to start with big data [closed]

I would like to start learning about the big data technologies. I work in this area in the future. Does anyone know good books to start learning about it? Hadoop, HBase. Beginner - intermediate - ...
0
votes
1answer
662 views

RegEx bug in MongoDB

I run the following queries on a collection that have a lot of entries that contain [ and ]. db.test.find({word:/[\[]/}); // could not be run in console db.test.find({word:/\[/ }); ...
1
vote
2answers
1k views

Disk space recovery on Mongodb replicaset secondaries

Is it possible to recover disk space on replica set secondaries based on the results of a repairDatabase call performed on a primary? I can't seem to locate anything that would work short of bringing ...
2
votes
2answers
270 views

Sharded MongoDB backup solution

I am looking for a way that I can backup my 12 MongoDB shards into a single server. Disk space is not an issue but getting the backups to be on a single node would be the best. I am not sure if there ...
2
votes
2answers
3k views

Mongo replicated shard member not able to recover, stuck in STARTUP2 mode

I have following setup for a sharded replica set in Amazon VPC: mongo1: 8G RAM Duo core (Primary) mongo2: 8G RAM Duo core (Secondary) mongo3: 4G RAM (Arbiter) Mongo1 is the primary ...
2
votes
2answers
536 views

mongodb service not running after changing path

I have changed the dbpath of mongodb.conf. And after that trying to start mongodb service,when I run sudo service mongodb start I get back mongodb start/running, process 7320 After that I run: ...
0
votes
1answer
320 views

Choosing shard key and friendly URL Ids for my MongoDB

I have decided to use MongoDB as my Database for a web application. However, I have some difficulties to get started and I hope that you can help me out with a few questions. I am developing my ...
5
votes
1answer
200 views

Management tool for managing MongoDB sharded cluster

Is there a database management software for MongoDB that makes it easy to create a cluster, add shards, backup shards and all the complicated stuff. There are some many MongoDB clients but they are ...
2
votes
1answer
256 views

Preserving whitespace in MongoDB values

In a simple scenario of me inserting a key-value pair, when value contains some white space, how can I preserve it? Example: > > db.bar.insert({"name":"mike "}) > > db.bar.find() { ...
3
votes
1answer
803 views

MongoDB geospatial query with sort - performance issues

I have query (which is very slow ~2,5s): db.markers.find({ latlng: { '$within': { '$box': [ [ -16, -140 ], [ 75, 140 ] ] } } }).sort({_id: -1}).limit(1000) When I run explain for this query I get ...
0
votes
1answer
2k views

How to keep Mongodb log small via the conf file (or other persistent method)

This is related to my question in stackoverflow where vb.net simply hang on updating a mongodb query. http://stackoverflow.com/questions/12780258/insert-mongodb-using-vb-net/12796593#12796593 After ...
2
votes
1answer
2k views

Can't start mongodb in ArchLinux

I have installed mongodb using sudo pacman -S mongodb in my 32-bit arch . At first I run this sudo mkdir -p /data/db to create /data/db ,and then run $ mongod ,then I got the following message : ...
0
votes
1answer
272 views

Moving a collection to a new database (v2.2)

To take advantage of the improved concurrency in Mongodb 2.2--namely database level locking--we would like to move a sharded collection to a new database. I have been unable to find any documentation ...
1
vote
1answer
140 views

Riak in SasS application

I am thinking about using Riak for a SasS application I started working on recently. I was originally thinking about MongoDB but after running into Riak it seems like it may be the better option. The ...
2
votes
1answer
2k views

Error “cannot connect to server” installing MongoDB on Ubuntu

I'm trying to install MongoDB on Ubuntu 10.04. I followed these installation instructions. I got the following error: Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 ...
0
votes
1answer
90 views

Why searching with $all in Mongodb is FAR SLOWER than the EQUIVALENT search?

$all with only one item is equivalent with normal search right? Here is the log without $all (I used 4700 test cases with 30 thread): Thu Sep 20 17:27:05 [conn11] query newisikotagte15.tablebusiness ...
2
votes
1answer
1k views

Storing dictionaries in mongo

Is there any reliable and fast database architecture that allows to store a dictionary(containing up to hundred thousand words) using mongodb?
2
votes
1answer
244 views

Best embed/reference/field strategy for many inserts (mongo)

I'm building a gaming backend with Mongo, and have some issues on how to best design the schema to maximize performance and database size. My models: User Match -ReferenceMany (User) ...
0
votes
1answer
56 views

Why $in is much faster then $all

I am well aware of what those 2 do. $in take .3 seconds. And $all take 26 seconds. Huge different. If anything $in should take longer because it returns more data. Also if the limit is removed, $in ...
1
vote
1answer
813 views

$nearSphere returns too many data. What am I missing? Am I wrong? Is it a bug? Does other see the same thing?

I noticed that $near and $nearSphere returns completely different data and I got suspicious. After all, when latitude is near equator it sphere distance shouldn't differ a lot from euclidean distance. ...
2
votes
1answer
2k 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/ ] } } ...
0
votes
1answer
98 views

Is Index Used for This Query

If so, which one? How do we know? I have 3 indexes in a query. Actually only the first 2 should be useful { "v": NumberInt(1), "key": { "LongitudeLatitude": "2d", "Prominent"▼: ...
1
vote
1answer
895 views

How to interpret this “db.explain()” for this mongodb query

db.tablebusiness.find({ "LongitudeLatitude" : { "$within" : { "$centerSphere" : [[106.772835, -6.186753], 0.0089967464101566] } }, "indexContents" : { "$all" : ["warung"] }, "Prominent" : { "$gte" : ...
3
votes
2answers
7k views

Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 when changing mongodb data directory

I already change the owner of the directory I want to use root@ip-10-138-30-205:/media/newdrive# ls -l ...
3
votes
1answer
875 views

Mongo connection failing with 'Transport endpoint is not connected'

I have a 2 server installation. A web server with Apache and a DB server with MongoDB. I am load testing it, and on ~300 RPS I am getting this error: PHP Fatal error: Uncaught exception ...
-2
votes
1answer
239 views

Compare MongoDB and MySQL

Can anyone help me to make right decision for choosing scalable and reliable database? I have to create 3-4 tables with around 200 columns each and these tables will have around 5000 data records. As ...
1
vote
1answer
166 views

What's the fastest way to replicate data?

I have a mongodb database data on my computer. I want to upload that into amazon.com server. The bottle neck is the internet connection. One way is to zip the file and then upload it to the server. ...
3
votes
2answers
265 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 ...
5
votes
1answer
5k views

Mongodb - Returning the points nearest to a location, with distance

What is the MongoDB's equivalent to this query: SELECT 111151.29341326 * SQRT( pow(-6.186753-`Latitude`, 2) + pow(106.772835-`Longitude`, 2) ...
0
votes
2answers
601 views

Where can I find manual and tutorial for rockmongo? [closed]

I tried to find it in google and couldn't find it. Most just tell how to install. None tell how to use execute, for example.
1
vote
2answers
997 views

Where can I get this nice phpMyadmin features for mongodb

In phpmyadmin Say I browse a table, or do anything. I will be told the actual sql command that I should run to execute the query. Say I want to do a query and then I want to do something else ...
2
votes
2answers
2k views

How to display query result in rockmongo by using execute method

I executed a command in mongo.exe > db.tablebusiness.find({"_id": "the-simmons-paradise__41.85_-87.88"}); I got results: Now I try similar command in rockmongo. If I execute ...
3
votes
2answers
975 views

mongoDB rs.initiate hangs

I am having trouble setting up replication on a new mongoDB installation. Everything works fine when I run without replication but when I run mongod with the --replSet option, and run rs.initiate(), ...
6
votes
1answer
2k views

Mongo cannot find my collection

My mongodb server has a database named villageContents It has a collection named tablebusiness If I run mongo I saw MongoDB shell version: 2.0.7 connecting to: test > I wonder what "test" is. ...
2
votes
1answer
583 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
7k 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
359 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
636 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
999 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
80 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
491 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
85 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
207 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.