Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
382 views

how to add shard into current cluster without sharing any chunks

my current cluster sh.status() is as below: shards: { "_id" : "rsDev", "host" : "rsDev/10.60.90.224:27003,10.60.90.224:27004" } { "_id" : "rsRaw", "host" : "rsRaw/10.60.90.224:27001,10....
0
votes
1answer
507 views

How to update collections and restore while doing mongorestore?

is there any way that i can update the collection and restore the same from dump created by mongodump cmd . when we do mongorestore , it directly restores from the dump , but my requireemnet is to ...
0
votes
1answer
536 views

Inserts very slow near the end of dataset

I'm trying to insert Whois Records ( domain name and relevant info) into MongoDB after parsing them from CSV files. I currently have a collection for each tLD such as .com, .org etc. During the ...
2
votes
1answer
1k views

Is it possible to run MongoDB javascript scripts in DBeaver

DBeaver's wiki shows a simple query against a Mongo database but what about admin scripts? It would be great to develop these in DBeaver but I've tried a few permutations to no avail. Here's an ...
0
votes
1answer
207 views

MongoDB Ops Manager

I have few questions regarding backup process in MongoDB Ops Manager 1) How backup process works ? 2) According to documentation for production do we need to have 3 dedicated servers for ...
0
votes
1answer
585 views

Mongod with bind_ip error “Address already in use”

I'm trying to follow the MongoDB docs tutorial on how to setup a replica set. The command example they provide has a bind_ip parameter, which is not working. If I run the command without it mongod ...
1
vote
2answers
3k views

Issue while restarting - MongoDB

I had tried to start the MongoDB service using the following command in linux machine. service mongod restart I am getting the following error Stopping mongod: ...
2
votes
2answers
140 views

MongoDB Shell support for map.set()

I am trying to use the MongoDB shell to run some scripts. Inside the JavaScript I am attempting to run var map = new Map() then map.set(1,1). However, I am getting the following error: E QUERY [...
1
vote
1answer
684 views

how to fix replica set error

I am getting this error { "ok" : 0, "errmsg" : "server is not running with --replSet" } when I run the command on windows cmd rs.initiate( { _id : "repl1", members: [ { _id : 0, host : "mongodb0....
0
votes
0answers
18 views

Mongodb TTL Index not expiring documents from collection

I have TTL index in collection fct_in_ussd as following db.fct_in_ussd.createIndex( {"xdr_date":1}, { "background": true, "expireAfterSeconds": 259200} ) { &...
1
vote
0answers
22 views

MongoDump Failed: error writing data for collection `collection` to disk: error reading collection: EOF

[BACKUP COMMAND] mongodump --host 127.0.0.1 -d database --port 27017 --username username --password password --out /output/path/mongodump_DATE_12_00_AM [ISSUE] Failed: error writing data for ...
2
votes
1answer
1k views

Merge 2 mongodb databases

Our team have hard time. Situation: API went down, all infrastructure (API + MongoDB) terminated. We restore API and mongodb (data restored from backup). After a while (let's say 1 day) we discovered ...
0
votes
1answer
324 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 ...
1
vote
1answer
623 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 ...
0
votes
2answers
718 views

Why --audit commands does not work in Mongo Enterprise

I am trying to make destination for my user activity log but every time I type --auditDestination I get errormessage "unrecognized option --auditDestination", can anyone tell me what should I do? I ...
0
votes
1answer
327 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
1answer
388 views

mongo2.6 local file size on secondary is much larger than primary

I set up a new standalone mongo2.6 and copy one folder(database) from another machine to its data path. (cause I enabled directoryperdb) Then I set up another machine to make them as a replica set. ...
0
votes
1answer
210 views

how mongo db does locking for updates/inserts?

I have many data for each user that with write heavy and many for each separate users that there is not any relation between user's data; so there is two options for me to store them: 1. keep all user'...
0
votes
0answers
9 views

Structure to store/analyse Typeform results

I am working at a company which sends surveys to companies using TypeForm, we now want to fetch the data from TypeForm using Webhooks, this is not an issue, here is an example of the payload I get ...
3
votes
1answer
2k views

MongoDB crashes with out-of-memory or is being killed by oom-killer

A two shards MongoDB database regularly crashes with out-of-memory error or is being killed by the oom-killer. The system runs on GCE Debian 9.4 with MongoDB v3.6.5, WiredTiger storage engine and ...
0
votes
1answer
14 views

MongoDB - count current read/write operations

is it possible to count the current read or write operations on a mongodb replica set? (including all databases not just a single database) Thank you! Best regards
0
votes
1answer
615 views

mongodb crashed with the error or permission denied

Our mongodb server was running for the last two months without any error. Suddenly it crashed and below is the log. 2017-08-11T13:41:41.320+0100 E STORAGE [thread1] WiredTiger (13) [1502455301:...
0
votes
0answers
17 views

Adding multiple indexes to avoid skip/limit in MongoDB

Let's say I have a MongoDB's database with millon of records having a City name, a User name and an activity. City | User | Action ------------+--------+------------------- Gotham | ...
4
votes
1answer
640 views

Why does restarting MongoDB 3.0.x boost performance?

I have a MongoDB in my Development environment running on Windows, the server has 64GB of RAM, but MongoDB has only consumed 26.9GB (here we are building the database), so it should be able to hold ...
1
vote
1answer
1k views

What's the difference between DISTINCT_SCAN and IXSCAN in explain output?

In Mongo 3.4 explain("executionStats").distinct(...), for some queries the winning plan contains an IXSCAN step, and for other queries it contains an DISTINCT_SCAN step. What is the difference ...
7
votes
2answers
3k views

verify that mongos server is connected to config servers

I've been writing a backup script for sharded replica-sets and it's almost done, except that I can't seem to get it to successfully start the balancer back up after everything's all said and done. ...
1
vote
1answer
634 views

MongoDB 3.6 create local Shard db without replica

This is what I want to do: Create a Config Server Create 2 Shard Create a Mongos Router I don't want to replicate my data using replica set, I want to simulate that each shard has only a part of ...
1
vote
2answers
4k views

How can I query matching MongoDB documents and return a subset of fields from an array of embedded documents?

I have documents similar to the following: db.etudiants.insert( { nom:'emile', prenom:'zola', cours_reussis:[ { intitule: ['PAI'], ...
0
votes
2answers
48 views

Oplog incremental backup failure

I have scheduled oplog incremental dump using mongodump but it fails very often on majority of the servers. I have a shard cluster with around 200GB of oplog size defined and around 30-40 hours of ...
3
votes
1answer
291 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
0answers
481 views

How do I add and/or modify $jsonSchema for a MongoDB collection from within the NodeJS driver? [closed]

I would like to use the MongoDB native schema functionality in a Node application using the MongoDB NodeJS driver. I do not want to use Mongoose for this. Mongoose has it's own implementation of ...
0
votes
1answer
2k views

MongoDB 3.6 crashed due to invariant() failure

MongoDB crashed twice in 6 hours today due to invariant() failure. We have been using MongoDB 3.6.3 for more than a year now, but this is the first time that we saw this issue. The extract from the ...
0
votes
1answer
23 views

Cannot restart or repair mongodb database after the crash (***aborting after invariant() failure) [closed]

After an unexpected crash, I can't restart or --repair the mongodb database anymore. While restarting the server with systemctl restart mongodb I am getting the following: 2020-09-16T20:25:23.835+...
1
vote
1answer
292 views

MongoDB specifying shard key and sharding strategy

What is the syntax to state that a collection is to be sharded as location based, while using the range based sharding strategy. I know you have to use the the sh.shardCollection() command, but what ...
0
votes
1answer
129 views

Slow performance of query with $and & $or operators

My query with $and, $or operators is performing poorly. Even though I've built a compound index on all three fields that are specified in my query criteria, the query does a complete collection scan. ...
0
votes
2answers
2k views

join two collections with group by and sum in Mongodb

i have this two collection and i want to join, after this I want to sum the value of TotalPrice each orderdate : some line of my two collections the first collection date : {"Id_Date":1,"...
1
vote
1answer
1k views

Mongodb: Determining shard key strategy on compound index

I have a collection with 170 millions+ documents and it is only going to increase. The size of the collection is not that huge, currently around 70 GB. The collection has two fields indexed on: {...
0
votes
0answers
9 views

mongo replica is down

I have A mongo replica with 6 nodes, not sure why but 4 of them went down and two entered to recovery state. each time I tried to start the service of one of the down nodes it fails with error there ...
1
vote
1answer
2k views

duplicate key error index MongoDB

I have rocket.chat server connected to LDAP. When one of users try logging to their account he get logged to someone other account, it's probably because indexes. My logs look like this: [...
0
votes
0answers
24 views

“any” + comprehension list in pymongo query [migrated]

I would like to write a pymongo snippet to query from a database all documents having a specific field value within a given list (so also a value which is a subset of any element in the given list). ...
1
vote
2answers
543 views

mongo primary is showing behind the primary?

mongo primary is showing behind the primary ?? Its increasing as time passes . Please suggest ? monRepl:PRIMARY> rs.printSlaveReplicationInfo() source: xxxxxx:27017 syncedTo: Mon Apr 27 2015 ...
4
votes
1answer
5k views

Restore mongoDB by --repair and WiredTiger

We accidentally deleted the directory rm -rf /data/db which was our MongoDB path, and thanks to extundelete, we recovered it and got the directory /data/db. Here are our files in the directory, and ...
0
votes
1answer
1k views

Mongo DB sharded cluster fails when one shard is down

I am using Mongo Sharded cluster with two shards. There was an issue on my one shard and and it was down for around 30 minutes. It stopped my writes to other shards also. Logically if one shard is ...
0
votes
0answers
4 views

Logical Sessions not closing at MongoDB 4.2 [duplicate]

How do I close my all idle connections in MongoDB as forcefully?
2
votes
1answer
121 views

MongoDB: Mongoimport server selection error , connection refused, too many files open

Trying to insert several JSON files to MongoDB collections using shell script as following, #!/bin/bash NUM=50000 for ((i=o;i<NUM;i++)) do mongoimport --host localhost --port 27018 -u 'admin' -...
1
vote
2answers
1k views

Copy Specific Columns from DB 1 To DB 2 on MongoDB

I have Two Instance of Node JS server which is handled By NGINX. First server is connect with MongoDB First Server i.e mongoose.connect('mongodb://127.0.0.1/db_primary', { useMongoClient: true }); ...
0
votes
1answer
12k 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
0answers
9 views

How to populate array from mongoDb un Dotnet Core? [migrated]

I would like to inquire regarding the query of data from a database in MongoDb. I'm learning about it, and the documentation is still a bit difficult for me to understand. The thing is, I want to ...
4
votes
1answer
1k views

Mongodb crash after WiredTiger Cannot allocate memory error

I am using MongoDB (3.2.6) as storage for my application and since a couple of weeks MongoDB started to crash usually every 1 or 2 weeks. The crash seems to come from an issue during WiredTiger memory ...
0
votes
1answer
16 views

Mongo Database - Dirty Shutdown

We have a major issues on our MongoDB and I've attached the latest logs and files. In previous forumns I've seen this get fixed by your team. Can you please help as soon as possible please, we are a ...

1
2 3 4 5
43