Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
4k views

Multiple BindIp in MongoDB 3.4.1 on Debian Jessie

I just upgraded from MongoDB 3.2 to 3.4.1. /etc/mongod.conf had a multiple BindIP: bindIp: [127.0.0.1,192.168.20.1] This is not working anymore. I get this error : Scalar option 'net.bindIp' must ...
4
votes
1answer
1k views

How to generate this MongoDB diagnostics HTML report?

I'm seeing this kind of report in many JIRA bugs and I want to generate it for my mongo instance. What software was used for generating it?
4
votes
2answers
25k 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
2answers
4k views

Does a replica set with only two machines make sense?

A lot of MongoDB tutorials, when they talk about replica sets, give examples of two machines: one originally initialized as primary, and another one originally created as secondary. As I understand ...
4
votes
3answers
7k views

Why does Mongo query hang for a long time when creating index?

We are migrating our single Mongo instance to Mongo cluster with sharding. I haven't started sharding yet. However, I found out when I try to add an index, I can't query any collection anymore. We don'...
4
votes
3answers
21k views

How to run MongoDB as a non root user in Linux?

I can start MongoDB as $sudo service mongod start. When I start without sudo it gives me this error: /etc/init.d/mongod: line 58: ulimit: open files: cannot modify limit: Operation not permitted /etc/...
4
votes
1answer
9k views

How to convert _id field of all existing documents from type String to Number

At one of my collections I have an _id field that stores numbers. The field was defined originally in the Mongoose model as String. However, all the data concerning this field in the collection ...
4
votes
1answer
2k views

Hash index use case in MongoDB

Recently MongoDB added hash index to its features but in the documentation doesn't explain much about hash index use case and its privileges to normal MongoDB index. So I'll be grateful if you guide ...
4
votes
1answer
3k 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 ...
4
votes
2answers
5k views

When is the _id index used?

When is the _id index used by MongoDB? I could not find anything specific about it in Index Introduction, Analyze Query Performance, and Query Plans. When sorting by _id at the end of the query via ....
4
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 ...
4
votes
1answer
18k 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" : ...
4
votes
1answer
3k views

How does MongoDB store data in RAM?

I'm trying to sift through the remains of an event that was causing us a lot troubles. Aside from report to management about what happened, I'm trying to gain a much better understanding of how this ...
4
votes
2answers
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(), ...
4
votes
1answer
6k views

MongoDB: operator to match arrays whose elements are all contained in a specified array

The $all operator selects the documents where the value of a field is an array that contains all the specified elements. In my situation I need the opposite: an operator that selects the documents ...
4
votes
2answers
12k views

MongoDB - Unable to change mongodb storage engine to WiredTiger

I have installed MongoDB in Ubuntu 14.04 but I am unable to change its storage engine to WiredTiger. I have added the necessary changes to the /etc/mongod.conf file which is namely as the following-: ...
4
votes
2answers
8k views

MongoDB uses only one index on simple query with sorting

So the problem is that I'm having a huge collection and I'm trying to run a query that filters and sorts on only fields that have indexes on them. I have these two indexes: db.getCollection('product'...
4
votes
1answer
6k views

Mongodb high lock percentage / slow queries

I'm working with an application using MongoDB that is getting a fairly large number of incoming requests and I've noticed that the responses are getting slower as the number of requests get higher. ...
4
votes
1answer
12k views

mongodb distinct() in an array

In my mongodb database,there is only one document below: { "_id" : ObjectId("5226efc5ccf23796f9590f67"), "count" : NumberLong(126045), "eissn" : "1466-5034", "grade" : 0.0, ...
4
votes
1answer
5k views

Why does mongodb virtual memory get so large

I have just compiled MongoDB in my linuxOS and not insert any data into DB. The virtual memory is getting very large, about 40G. ps aux|grep mongod mongodb 176574 0.0 0.0 423784 39008 pts/308 ...
4
votes
2answers
2k 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.
4
votes
1answer
1k 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 ...
4
votes
1answer
7k views

MongoDB SSL peer certificate validation failed: unable to get issuer certificate

I have enabled SSL on MongoDB with optional SSL connection: preferred. I have used lets encrypt in order to obtain SSL certificates. SSLs works as expected and in mongod.log file I can see that: ...
4
votes
1answer
162 views

MongoDB: Can I have a delayed secondary that doesn't vote?

I have a replica set setup with 1 Primary, 1 Secondary and 1 Arbiter; each on a different data center. I want to add a delayed secondary to one of the existing data centers, but I don't want it to ...
4
votes
1answer
1k views

Mongodb incremental oplog Dump not working

I am not able to take an incremental oplog dump. I am not getting any error messages the connection happens fine and also there is a operation recorded(shows up in db.currentOp()), but still nothing ...
4
votes
1answer
1k views

Should I deploy Mongodb sharding for 50 collections?

I have a 10 node clusters that runs about 50 concurrent jobs. Each job needs to read/write a separate collection. So I have about 50 collections roughly. Each collection has about 20 M records. Most ...
4
votes
2answers
2k views

Limit memory used for mongoDb

Is there any way to limit using RAM for mongodb on Debian? I'm looking for a solution fo about 8 hours, but have no results.
4
votes
1answer
566 views

MongoDB in ReplicaSet databases showing different sizes and objects

I have a MongoDB in a ReplicaSet with 3 members, and last week the primary node got corrupted somehow and stopped. I had to resync the data from the other nodes. It has been a week but I was checking ...
4
votes
2answers
2k views

How to add userAdmin user in Mongodb Atlas

How to add a user with userAdmin role in Atlas? The Cluster Security "Add New User" UI https://cloud.mongodb.com/v2/.....#clusters/security/users shows only limited set of built-in roles without any ...
4
votes
2answers
12k views

How to set up a user who doesn't have `admin` database access but use it as authentication database?

I want to setup a user in MongoDB. This user will not have admin database access. But it uses admin as authentication database. It will fail to connect the mongoDB by this command mongo --host ...
4
votes
2answers
52k views

MongoDB: All commands spit out “not authorized on admin to execute command”

Mongo version: 3.2.11 I spun up a mongoDB droplet with DigitalOcean so that I could have a database connected to my little game. However, complications after complications have arisen. I am ...
4
votes
1answer
70 views

Should images be separated from posts in MongoDb?

I am working on a project with Meteor.js and I am using CollectionFS with GridFS to easily store images in MongoDb. Now I am not the best with databases and database design, but I heard that in nosql ...
4
votes
1answer
2k views

Drop/Create MongoDB TTL index vs. collMod in production

I'm working with a MongoDB collection containing over 250 million documents that has an existing TTL index and is written to with a pretty high frequency. I'd like to reduce the TTL value for the ...
4
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 ...
4
votes
2answers
11k views

Multiple IPs are not getting bind in mongodb conf file

I am trying to bind multiple IP to mongodb config file, one is 0.0.0.0 and other is 127.0.0.1. I did the following change in configuration file /etc/mongod.conf # network interfaces net: port: ...
4
votes
1answer
4k views

MongoDB replica set: members with different versions of mongod

The primary is running mongod 3.0.6 and the secondaries running mongod 3.0.7 is a mixing of versions allowed in the same replica set? For upgrade it's best practise to not all nodes the same time.
4
votes
1answer
7k views

MongoDB Insufficient free space for journal files

I have installed a standalone mongo 2.6 in amazon ec2. The instance has reach the limit of disk space and it doesnt run now. I have set before the smallfiles=true in mongod.conf file, but for some ...
4
votes
1answer
1k views

MongoDB failover reasons

I have a replica set on MongoDB with 3 members - primary, secondary and arbiter. One day I came and saw that primary and secondary have switched. I'd like to find a reason for the failover that caused ...
4
votes
1answer
5k views

MongoDB - Adding a new server to an existing replica set with auth enabled

Short version: Is there a way to add a new SECONDARY server to an existing production MongoDB replica set without downtime, and without temporarily disabling the "auth" and "keyfile" config settings ...
4
votes
1answer
2k views

Best design of mongo replica set for DB read/write speed

I'm building a Node app that uses MongoDB. Whilst it would probably be fine to have node and mongo sitting on the same VPS, I want to ensure that the MongoDB is backed up and maintain high ...
4
votes
2answers
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 ...
4
votes
1answer
4k views

MongoDB Connectivity Issue

From last few days, I am facing connectivity issues with MongoDB Replica Sets deployed in google cloud. Interesting fact is these issues are appeared at Development machines and not on the production. ...
4
votes
2answers
19k views

MongoDB import bson files from a folder

I am unable to import (.bson) file on my computer to MongoDB database .I have been trying below commands : 1)mongorestore -d demo -c dcoll C:\data\dump\twitter\tweets.bson and 2)mongorestore -d ...
4
votes
2answers
7k views

Creating mongodb database with ansible playbook

How i can create MongoDB database with Ansible? is it possible? If not, can i do this with bash script? I tried to use mongodb_user module for Ansible, but it cant work without existing table.
4
votes
1answer
905 views

Using Mysql and MongoDB together

I currently have all of my data in a MySQL database which handles my entire application system. My current setup is a Java desktop application that publishes data to the database through a NodeJS API. ...
4
votes
2answers
21k views

Return document that has $max value in specific field using mongodb

I have a json file that has some football results. I need to calculate which team won the most away games, and how many wins there were. My query is this: db.football.aggregate( {"$unwind": "$rounds"...
4
votes
1answer
805 views

What is the best way to reload data in MongoDB

I am benchmarking MongoDB using YCSB framework using the latest drivers. During the benchmark, I change the cluster setup (adding/removing shards) extensively and delete/insert workloads in the order ...
4
votes
1answer
549 views

MongoDB Fails to get TGT

I've setup MongoDB enterprise on CentOS 7 with Kerberos support. Additionally I've setup a Kerberos service on CentOS 7 for the authentication. I know that Kerberos is setup correctly as I now have ...
4
votes
1answer
824 views

Force a Member to Become Primary when Primary fails in mobgodb

I have mongodb 2.6.11 cluster of two members: nms02 and nms01m. I know how to force secondary to become primary when primary is avail. But now my primary nms02 failed..and nms01m is secondary...How I ...
4
votes
2answers
4k views

How to index an property object in MongoDB?

I've the following sample document: { "_id" : ObjectId("556e177ca43da29e040041a7"), "user_id" : NumberLong(24), "request_datetime" : ISODate("2015-06-02T15:52:12.000-05:00"), "...

1 2 3
4
5
44