Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mongodb]

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

0
votes
0answers
6 views

Can't connect to mongodb using username/password. Can connect without credentials

I have a docker-compose.yml file. version: "3.7" services: ############################## # Back-End Container ############################## backend: container_name: mern_backend build: ...
0
votes
0answers
4 views

MongoDB ticket availability reaching zero

I recently came across intresting issue. I have a sharded cluster which has two replication sets with 2 secondaries. On my primaries, there were 300-400 connections at a point in time, shortly after ...
0
votes
0answers
5 views

Joining on nearest timestamp in MongoDB

MongoDB version: 3.2.11 Coming from using primarily PostgreSQL, I am new to MongoDB and am having trouble constructing complex queries in the required JSON format (where in SQL I would use CTEs). To ...
1
vote
0answers
31 views

Noob Questions - Database approach

I have a database of "records" that relate to photos - title, location, text, tags, etc. I am now adding more fields for other media types, videos for example will get an transcript, audio will get ...
0
votes
0answers
21 views

MongoDB count() query returns outdated result in mongo shell / python script

Documents in my MongoDB collection are changing status field very frequently. I can observe it using a mongoDB client (Robo 3T). Now I'd like to monitor this process using mongo shell (or python ...
0
votes
0answers
26 views

Mongodb - Document versioning [on hold]

Have anyone implemented document versioning or storing history data of the document for analysis in mongodb. Sort of change data capture but we need to store them and preserve for later analysis if ...
0
votes
0answers
39 views

Mongoexport and mongodump disk usage rationale

I just had an interesting experience with the mongoexport tool and came out with a doubt about the exporting process' disk usage. I was trying to dump a 50 MB collection to a disk that had 3 GB free ...
0
votes
0answers
23 views

Fetch only those record which do not have matching amounts

I have a mongo collection as shown below { "_id" : ObjectId("5c5c86633b897535539c1b36"), "studentId" : "dsdlkjafhiuelfdldahfiu", "marks" : [ "subject" : "Physics", "...
0
votes
1answer
41 views

Mongoexport halts when it reaches 101 records

I'm trying to dump a MongoDB collection from a remote server to a local JSON file. First, I do some ssh port forwarding to begin with: ssh -NL 12345:localhost:27017 $REMOTE_USERNAME@$REMOTE_HOST &...
0
votes
0answers
21 views

Mongo Ops Manager Cant Find process for member

When starting mongo ops manager and checking mongodb process it shows 0 mongods, and in system warnings throws the warning "Unable to find process for member XXX:27020 in rs_1" I can conect from all ...
1
vote
1answer
64 views

Getting error while creating a New Connection using Studio 3T for Mongo DB

I tried to create a new connection with Studio 3T for Mongo DB. I don't have a previous DB connection and this is the new one that I am trying to create it. I can't able to figure out why this is ...
2
votes
1answer
76 views

Hosting Multiple MongoDB Databases on the same MongoDB Instance/Cluster

In MongoDB there are the following conecpts: A MongoDB database exists as a logical unit on a MongoDB Instance which is either a singleton or a cluster running within some number of mongod processes ...
1
vote
1answer
28 views

MongoDB UserNotFound when starting mongod

I have a MongoDB version 2.4 that i wish to upgrade to 4.0. The official solution is to upgrade from 2.4 to 2.6, then to 3.0, and so on. I am attempting to upgrade from 2.6 to 3.0, and also to change ...
-1
votes
1answer
32 views

MongoDB Performance of Overwriting an Array Field vs Individually Updating the items

The problem I am facing is basically updating the inventory when an order is received in a MongoDB database.The general hierarchy is as follows Manufacturer: { ... Items: [ ... ...
1
vote
1answer
66 views

No shardIdentity document - MongoDB

Having a sharded cluster in production which has been running for a good year now without issues. Everything is on 4.0, classic 3-3-3(config) + 2 mongos. While revisiting our back-up strategy i ...
0
votes
1answer
23 views

Ops Manager Install in Windows and connect to mongod instance started in linux

Can we install ops manager in windows and connect to mongodb instance started in Linux operating system? Does ops manager installation on windows require separate installation of mongoDB instance on ...
0
votes
1answer
44 views

MongoDB - Database vs Collection memory-wise

Lets say for example i need to have 5 collections, each collection is about 10GB. What is the difference in performance, with emphasis on memory usage, between assigning each said collection to a ...
0
votes
2answers
77 views

Audit Trail in NoSQL vs. Relational DB, audit trail feature in MongoDB [closed]

Two questions regarding selection a DB type and engine for the scenario when the Audit Trail functionality is a must: Is there any preference in DB type (NoSQL/Relational) choice when the Audit Trail ...
2
votes
0answers
87 views

Mongo Db Update (upsert) taking several seconds

Machine Specs: 12 Cores 64GB Ram Mongo Setup: Mongo Version 4.0.5, XFS file system (Flash SAN backed), 1 replica set with 2 replicas, 10GB network all local (sub 1ms latency) Operation Being ...
0
votes
0answers
8 views

Integrating MongoDB metrices with Cloud watch

We are hosting mongodb in AWS environment and planning to create incident in Servicenow using AWS Cloud watch alarm facility Has anyone integrated MongoDB Monitoring metrices with Cloud watch to ...
0
votes
1answer
37 views

MongoDB 3.6, adding replica set always fails as on production setup with cannot open /dev/urandom Too many open files

I am trying on add a 3.6 mongoDB node to a 3 member replica set running 3.4. Doing this as a part of DB upgrade from 3.4 to 3.6. When I add the new member to replica set, it goes to STARTUP2, data ...
0
votes
1answer
29 views

Why am I seeing these mongodb 3.6.5 server log messages in huge amounts?

Could someone please shed some light on these mongodb 3.6.5 server log messages on the primary node of a 3-member replicaset? rs.status() says all the nodes are up and running but seeing a ton of (I)...
0
votes
0answers
37 views

[MongoDB]See Collections (and Files) created in a Shard on the Cluster

My structure: A Sharded Cluster with multiple Shards. Each Shard contains 1 Collection, which is pinned to it by tags. Every Shard is at the same time a ReplicaSet Secondary. It receives data from a ...
1
vote
1answer
35 views

Is mongoreplay included in the toolset with mongodb 4.0 community version for windows?

Where to find mongoreplay tool in mongodb 4.0 community version for windows? It is not in the same place as other tools - mongoexport, mongoimport, etc.
0
votes
0answers
21 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
35 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
40 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
50 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
36 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
33 views

How query optimizer works in mongodb?

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
27 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
18 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
54 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
74 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
31 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
23 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
18 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
86 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
49 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
7 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
27 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
25 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
126 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
67 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
45 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
37 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
54 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
25 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
48 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
18 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 ...