Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
3 votes
1 answer
3k 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 '...
Alex Frenkel's user avatar
1 vote
1 answer
559 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. ...
user4951's user avatar
  • 1,365
3 votes
2 answers
845 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 ...
user4951's user avatar
  • 1,365
7 votes
1 answer
14k 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) ...
user4951's user avatar
  • 1,365
1 vote
3 answers
4k 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 ...
user4951's user avatar
  • 1,365
2 votes
2 answers
6k 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 db.tablebusiness....
user4951's user avatar
  • 1,365
4 votes
2 answers
2k 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(), ...
user avatar
10 votes
1 answer
26k 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. ...
user4951's user avatar
  • 1,365
2 votes
1 answer
1k 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?
user4951's user avatar
  • 1,365
5 votes
2 answers
26k 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 ...
Sixty's user avatar
  • 151
4 votes
1 answer
774 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 ...
lovesh's user avatar
  • 185
4 votes
1 answer
1k 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. ...
nax's user avatar
  • 165
6 votes
1 answer
2k 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 ...
ragulka's user avatar
  • 161
0 votes
1 answer
150 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 ...
Sean Bannister's user avatar
1 vote
1 answer
1k 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 ...
ledy's user avatar
  • 695
1 vote
1 answer
140 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 ...
William Payne's user avatar
6 votes
2 answers
19k 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.
ledy's user avatar
  • 695
3 votes
1 answer
437 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 ...
William Payne's user avatar
9 votes
2 answers
7k 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.
ledy's user avatar
  • 695
1 vote
1 answer
180 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 ...
Lee's user avatar
  • 153
-1 votes
1 answer
213 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 ...
user4951's user avatar
  • 1,365
6 votes
3 answers
16k 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 ...
ledy's user avatar
  • 695
6 votes
1 answer
1k 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 ...
ankitb's user avatar
  • 88
21 votes
3 answers
47k 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 ...
ledy's user avatar
  • 695
3 votes
1 answer
3k 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 ...
ledy's user avatar
  • 695
11 votes
3 answers
10k 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 ...
Erhan A's user avatar
  • 223
6 votes
1 answer
2k 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 ...
bmargulies's user avatar
3 votes
1 answer
771 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.
Tyra's user avatar
  • 133
1 vote
1 answer
134 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?
A T's user avatar
  • 391
11 votes
2 answers
13k 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 ...
Chris W.'s user avatar
  • 591
-1 votes
2 answers
741 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?
userbb's user avatar
  • 1
11 votes
2 answers
16k 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> db.<...
Chris W.'s user avatar
  • 591
1 vote
1 answer
123 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. ...
Uri Laserson's user avatar
7 votes
1 answer
2k 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: ...
sysadmin1138's user avatar
3 votes
1 answer
180 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 query ...
Sean Bannister's user avatar
5 votes
1 answer
815 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 ...
Hersha's user avatar
  • 51
0 votes
1 answer
206 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) find(a=...
Majid Azimi's user avatar
  • 2,261
4 votes
2 answers
3k 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.
Majid Azimi's user avatar
  • 2,261
4 votes
2 answers
2k 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 ...
newuser's user avatar
  • 681
7 votes
1 answer
2k 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 }, { ...
antitoxic's user avatar
  • 171
13 votes
3 answers
19k 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 ...
RockScience's user avatar
4 votes
2 answers
2k 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 ...
Julias's user avatar
  • 141
8 votes
2 answers
5k 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 ...
Kaitsu's user avatar
  • 231
17 votes
1 answer
5k 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 ...
Riyad Kalla's user avatar
7 votes
1 answer
2k 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 ...
WildBill's user avatar
  • 525
6 votes
3 answers
2k 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 ...
WildBill's user avatar
  • 525
4 votes
1 answer
2k 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 ...
Raladical's user avatar
3 votes
2 answers
636 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 ...
user avatar
20 votes
5 answers
8k 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 ...
Justin's user avatar
  • 301
39 votes
4 answers
34k 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 ...
WojonsTech's user avatar