Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

Mongo Collection Mysteriously unavailable

We are running a mongo on single EC2 instance, we were not able to connect to it , upon debugging we saw CPU usage was spiking , this was the problem we faced previously we then restarted the instance ...
2
votes
0answers
60 views

MONGOS uselessly scanning indexed documents when counting on shards

I have a simple collection with 40M documents distributed over 2 shards. The documents contain a field named COUNTRY with a sparse index on it. db.contacts.count({ "COUNTRY": "US" }) I am trying to ...
0
votes
1answer
61 views

MongoDB Indexing - What happens if I don't index all necessary fields?

Let's say I have a collection with 20 fields and a query that uses 5 of them, to find the documents I need. 3/5 of those fields are always used in the query, 1 for equality comparison, 1 for range ...
1
vote
1answer
69 views

MongoDB Indexing - How many fields should I index?

I have a Collection in my db, called Post. Here's how it looks: Post { user: <EmbeddedObject>, school: <EmbeddedObject>, hashtag: <EmbeddedObject>, numberOfReports: ...
0
votes
1answer
39 views

What is the best way to cross check the record in multiple collections

I am developing the application in which system will show the campaign content to users which he/s never seen. To keep the logs either the specific user seen the specific content or not, i am ...
2
votes
1answer
127 views

How does the MongoDB query optimizer evaluate candidate plans?

The MongoDB query optimizer processes queries and chooses the most efficient query plan for a query given the available indexes This is an excerpt from MongoDB documentation. I am looking for more ...
1
vote
1answer
220 views

Connection string for connecting mongo database with SSL enabled

Am facing some below problem in my mongodb replication environment I have 3 replica set environment with SSL enabled and ssl mode as preferSSL 3 servers has 3 different Key file with common CA file ...
1
vote
0answers
29 views

mongo-hadoop connector makes duplicate data by numbers of Mongo Sharding

I'm using mongo-hadoop connector which makes that Hadoop can get data from MongoDB and save into MongoDB. I found MongoDB data is duplicated after Hadoop Map-Reduce job with MongoDB data. environment:...
0
votes
1answer
662 views

Mongo: Not authorized to do anything after enabling service on boot

I have been using MLab and MongoAtlas successfully for a project I'm working on. Now I'm trying to migrate the DB to local storage so that the software can write and store data without needing ...
2
votes
1answer
825 views

Why mongo is choosing the wrong index / execution plan?

In production mongod logfile, we can see a lot of slow queries. Most of them are not using the best index and consequently the best execution plan is not used. However, when I run the same queries by ...
0
votes
1answer
50 views

mongodb: Can I create an unshard Replica set for a sharded cluster?

I have a 3 node shard cluster mongoDB with replica set, and want to add (single node replica set) a un-sharded Replica set to collect all data in one node. Can I create an unshard Replica set for a ...
0
votes
1answer
78 views

Find and Insert Missing data in Mongodb Collection

I want to write python3 code to check and insert missing data. My MongoDB collection documents have one field named "height" which is BTC block number. I want to traverse in a range start to the ...
0
votes
0answers
37 views

Mongo OPS manager and mongod running under root account

I am trying to administrate and monitor databases by using Mongo ops manager. OS Version : Oracle linux 7 Mongod version : 4.0.5 enterprise Ops manager : 4.0.5 enterprise I have installed the ...
1
vote
1answer
833 views

MongoDB replica has no primary

I have an existing MongoDB setup (part of a Graylog installation) where I'm attempting to configure a replica set with a primary, secondary and arbiter. I had the primary and arbiter configured ...
0
votes
1answer
173 views

Invalid access at address: 0 for Mongo v4.0.5

I am running mongo on kubernettes in statefulsets. It was working fine for weeks then all of a sudden this morning i started getting errors where mongodb was failing. I tried running: mongod --...
0
votes
0answers
62 views

Mongo Atlas API - Get Databases and Collections in a Cluster

So with Mongo Atlas I can easily list clusters in a project by calling the API as follows: curl -i -u "<user@domain.com>:<my-api-key>" --digest "https://cloud.mongodb.com/api/atlas/v1.0/...
1
vote
0answers
77 views

Mongodb find document with too large key

I'm trying to create an index and I'm getting this error: 2018-12-30T15:28:30.853-0800 I COMMAND [conn580067] command db.$cmd command: createIndexes { createIndexes: "node", indexes: [ { ...
0
votes
1answer
89 views

Mongodb what is the cost of array queries?

As far as I can tell, find queries in mongodb involving an array appear very expensive. Take as example the queries given in: https://docs.mongodb.com/manual/tutorial/query-array-of-documents/ db....
0
votes
4answers
139 views

How to tell if a project needs a NoSQL database solution? [closed]

How to tell if a project needs a NoSQL database solution? I think that SQL limits define it. If the project needs bigger database or bigger fields then it needs NoSQL. Am I right? I looked into ...
0
votes
0answers
394 views

How to Recover Mongodb database

I have transferred my mongodb database to a new computer and am having trouble opening the database. I don't get any errors, it just won't show the 'finance' database. Here is the response when I say ...
0
votes
1answer
50 views

mongodb array query woes

I am struggling with array matching and getting multiple records back. "players" : [ { "pname" : "player_4", "loc" : [ -2.2, 1, 0] }, { "pname" : "player_2", ...
0
votes
2answers
168 views

mongodump download collections only if changed

If I get it right if to make mongodump in to directory that already contains previous dumped data it will still download full collection data even if is not different from data containing in the dir ...
1
vote
2answers
70 views

Is it possible to run an arbiter on a machine that also hosts a secondary member?

I have two machines (it is a restriction) configured as a replica set with MongoDB 3.6.5. Is it possible to run an arbiter on a machine that also hosts a secondary member? Even if it is not ...
0
votes
1answer
51 views

Replica Set Oplog Maxsize

I have two databases (Mongodb 3.6.5) using ReplicaSet, when I made a split in the network, I am forcing the secondary database to be the primary. cfg = rs.conf() cfg.members[0].votes = 0 cfg.members[...
0
votes
1answer
78 views

How to solve replication in MongoDB only with two machines?

I have two machines connected in a ring network, each one running Wildfly in HA mode using JGroups ant MongoDB in HA Mode using Replica Set. The machine 1 is the primary and machine 2 is secondary. ...
0
votes
0answers
21 views

Delete latest data from mongodb collection

I am using MongoDB 4.0. By mistakenly, I insert 100 BTC blocks transaction data in the wrong collection. Now I want to remove only that data which is inserted recently. I am not getting that how much ...
1
vote
0answers
271 views

Interesting Database Designs for Product Catalogue including a Recursive Approach

I am doing some work for a client and they are creating a database of products of which I need to consume product data when it's created and updated to store in a third party service and then present ...
0
votes
1answer
796 views

mongodb - what roles the user to grant access to all databases

I have created mongouser as testuser with below roles. I want to give access for new databases for this user. what roles the user to grant access to all databases. db.createUser({ user: "testuser" , ...
0
votes
2answers
154 views

How verify if replicaset is working?

I am newbie with MongoDB and even more in administration of databases. But my boss passed me an issue to solve. SCENARIO I have two servers using MongoDB and ReplicaSet, when I run the command db....
1
vote
0answers
63 views

Mongodb default setup on Azure - default connect string from local shell

I have a new Azure VM (Ubuntu 18.04.1 LTS) which has docker. dragam@USDockerVM:~$ IRE> docker --version Docker version 18.09.0, build 4d60db4 Issued the command docker pull mongo this ran ...
0
votes
1answer
140 views

mongodb replica set No Election of Primary with 6 of 7 Nodes UP

I have 8 instances running on Scaleway , 5 for Data and 3 Arbiter. And the versions of mongo on them are such : mongodb2 (mongodb 3.4.9) mongodb4 (mongodb 3.4.15) mongodb5 (mongodb 3.4.15) ...
0
votes
1answer
39 views

Backup of MongoDB collection data and rename the collections [duplicate]

I want to take a collections data backup on a different host, with renaming the Collections. I am very new to MongoDB. Please help me with this task.
1
vote
1answer
61 views

mongorestore to --oplogReplay or not to --oplogReplay?

The MongoDB documentation on --oplogReplay is a bit vague. It just keeps saying a "point in time" snapshot. How is this different from dropping the sink database and restoring from the source? What ...
0
votes
1answer
43 views

E: Version '2.0.25' for 'mongodb-10gen' was not found while installing this specific version

I'm trying to install version 2.0.25 for some testing work. I followed this documentation. Here are the steps: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo 'deb ...
0
votes
0answers
340 views

Forgot mongodb admin password

Forgot Mongo DB admin password, how can we get/reset it? Can we create new user with admin rights? Can we set admin by disabling any settings in config file?
1
vote
1answer
609 views

MongoDB merge two collections and drop documents with same value in field

In my database I have two collections, but some documents were added (possibly) at different times to both collections. I could use mongodump and then mongorestore for merging. But then I have the ...
1
vote
1answer
59 views

Mongodb as a data ware house?

Will mongodb a good choice as a data warehouse considering following situation? We are building analytics, report generation platform for our client and a typical table growth in terms of rows will ...
0
votes
0answers
27 views

Should images be embedded in a MongoDB document when there is a one to many relationship?

Please see the DDL below from my CQRS write database: CREATE TABLE Offer (ID uniqueidentifier NOT NULL, Description varchar(50), Image varbinary(max), primary key (ID)) CREATE TABLE Person (ID ...
1
vote
1answer
618 views

Mongo queries are slow and yielding/waiting for locks thousand times

We are using mongo setup with replica sets on AWS. Setup Details: 1 Primary node: r3.8xlarge 4 secondary nodes: r5.xlarge Mongo version: 3.0.8 (WiredTiger) Database size: 358GB We have configured ...
3
votes
1answer
130 views

Mongo WriteConflictException in log file

I am experiencing ALOT of this WriteConflictException in my mongo log file, this does not seem to affect the application, because I am not seeing any special errors and everything seems to work fine. ...
1
vote
1answer
79 views

Best practices for Feed restructuring in a social app database

I have a social app, where users can post to the school they chose on registration. Each post can have a hashtag and a school (all pointers, (hashtag is optional, school is not)). Users see posts ...
2
votes
0answers
35 views

MongoDB - Best practices for Feed restructuring in a social app database [duplicate]

I have a social app, where users can post to the school they chose on registration. Each post can have a hashtag and a school (all pointers, (hashtag is optional, school is not)). Users see posts ...
2
votes
1answer
350 views

Disk block size for mongodb deployment

Why does Mongodb production notes have no recommendations about the disk block size? AFAIU, disk block size would have a considerable impact on a throughput intensive application. Does disk block size ...
0
votes
1answer
5k views

MongoDB - Mongoose query findOneAndUpdate() doesn't update/duplicates the DB

I am trying to save and update (upsert: true - creates the object if it doesn't exist) the result of the Web Api which contains multiple arrays of data to populate the stock chart. Each time I enter a ...
0
votes
1answer
105 views

Equivalant MongoDB query of MySQL date query with arithmetic operations

How we can perform the below given MySQL query in MongoDB preferably in MongoDB-4.0: SELECT *,ABS(TIME_TO_SEC(TIMEDIFF(now(), datefield))/3600) as hours, (field1*field2*field2+field3*(1/(ABS(...
0
votes
1answer
82 views

MongoDB - The connection is not disconnected for a long time

I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB, The MongoDB connection pool of the server of the web site ...
0
votes
1answer
460 views

Change in bind_ip value is not reflecting

I have mongo installed on Centos instance in AWS and I am connecting to the mongoDB server from my system. To connect from remote system we need to change bind_ip value to 0.0.0.0 in /etc/mongod.conf ...
2
votes
1answer
282 views

Mongodb replica set primary and secondary node conf fail when one slave is down

In my env, I had created MongoDB replica set conf for high availability so one server fails should be handled by other also in my conf I have 3 DB server and 1 arbiter too but, my slave's server ...
2
votes
1answer
50 views

Getting exception on running sh.status() command on MongoDB sharded cluster

I am running sh.status() command on my mongos instance of sharded Mongo cluster and I am getting below exception. mongos> sh.status() assert: command failed: { "ok" : 0, "errmsg" : "error ...
1
vote
1answer
306 views

Service Discovery for MongoDB

What is the best way of implement a Service Discovery like ETCD for use in a mongodb cluster? I wish have, 1 master for HA and two nodes, in my master i have a static ip, but nodes maybe can changes ...