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
633 views

Expand a date range in mongodb

I have a document structure like { "startDate": ISODate("2015-01-01T00:00:00Z"), "endDate" : ISODate("2015-01-10T00:00:00Z"), "foo" : "bar" } Is it possible to expand the date range like this?...
0
votes
0answers
11 views

Preserve tab and line break while insert JSON string to Document in MongoDB

I'm inserting new document to MongoDB as following: db.crawl_api_config.insertOne({ apiHost: "logbasex.github.io", apiUrl: "20221", contentType: "Blog", ...
0
votes
1answer
161 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
129 views

mongorestore - documents fail validation

The similar question already have been asked: How to validate a mongorestore But how to actually validate the documents in mongodumb and mongorestore? And also - can I see the documents that fail ...
0
votes
0answers
36 views

Suggestion for NoSQL database for global users

We are planning to build a social media application, lets say similar to Instagram but at much smaller scale, of course. The users could be from many geographies like US, Europe, Asia who could ...
0
votes
2answers
376 views

usage percentage of Mongodb internal cache

I've ran two performance test on a MongoDB server with identical environment/settings AFAIK. I found that the throughput was 10% apart. When I inspected the mongostat logs, I found that Mongodb in ...
1
vote
1answer
141 views

mongorestore only one field of a document

i'm trying to restore my users : { _id: ObjectId, created_at: Date, preferences: String } I don't know why but created_at field from my users all reseted. So i need to use my .bson backup file ...
0
votes
0answers
19 views

Listening to mongodb change streams for indexing to elasticsearch

We have a mongodb 4.0 replica set deployment with a collection that stores social media posts. This table sees a lot activity with updates amounting up to 1000 requests per second occasionally. We ...
40
votes
3answers
69k views

MongoDB using too much memory

We've been using MongoDB for several weeks now, the overall trend that we've seen has been that mongodb is using way too much memory (much more than the whole size of its dataset + indexes). I've ...
4
votes
2answers
19k 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" : ...
0
votes
2answers
2k views

Replica Set in MongoDB by using IPs instead of domains?

I want to use MongoDB in replica-set mode over 2 servers by IPs.But when I deployed the secondary one on other server, I faced the issues about connecting between 2 instance. For example, the primary ...
1
vote
0answers
67 views

Table(s) indexing strategy for separable data [closed]

Scenario: The data needs to be indexed by location, all of the rows include location info and also city info. I want to index by location, but there are millions of rows. The idea is that I can create ...
1
vote
1answer
484 views

mysql to mongodb migration [closed]

I have table, with around 125 million records in MySql. I want to move it to mongodb. What would be the best approach to migrate this huge table to mongodb? I was thinking to fetch one by one row ...
0
votes
1answer
675 views

MongoDB Atlas M0 (Free Tier) BI capabilities

I'm using MongoDB in my server and developed BI tool using cube-js & mongosqld, which worked when mongo was running locally, however after I moved to Atlas using M0 tier I could not connect to it ...
0
votes
1answer
230 views

MongoDB cannot be started after moving the server

I had a happy MongoDB 3.0.5 installed on a VM on a Windows 2012R2 Server, for light use. I moved the VM to a new physical server without any major changes, and to my surprise it cannot be started; and ...
1
vote
2answers
18 views

how to run mongo export on macbook?

I am using mongodb Atlas (M0), which does not provide db backup feature. I am creating a nodejs script that will export all the collections automatically periodically. So far I have done the following:...
1
vote
1answer
786 views

How to properly use moveChunk when chunks of certain range needs to be moved?

A MongoDB 3.6.3 database has two shards and a mongodump file with partial data of one collection needs to be restored. The first shard is named "fast" while second "slow". The idea is to restore the ...
0
votes
0answers
30 views

“Document Failed Validation” what is wrong with my schema validation

I am trying to create a collection with JsonSchema (really its "BsonSchema") validation. This is a document that I want to insert (with bogus values). Note that Id is coming from the mongo ...
0
votes
1answer
587 views

mongoDB won't stop with shutdown or kill

Not sure If I can make the same question already made here but here it goes. I have a mongodb fork and running with high CPU usage. I'm trying to shut it down but nothing seems to work. 2729 mwon ...
0
votes
1answer
226 views

MongoDB stuck in startup2 state

I have a Mongo replica set (MongoDB server version: 4.0.3) with primiry, secondary and arbiter. Size of database is about 7 Tb. I add a member to replica set. It stucks in sturtup2 mode for a month! ...
1
vote
0answers
14 views

MongoDB Shema to support concurrent update on a document

We were working on a project with a 300 documents with currentValue field in a main collection, in order to track the history of each document of first collection. we created another collection named ...
0
votes
1answer
32 views

queryHash field not available in mongos slow query logs

Mongodb V4.2 has introduced queryHash in slow query logs to identify slow queries with same query shape. While this queryHash is available in slow query logs in mongod logs (shard server), it is not ...
1
vote
1answer
3k views

MongoDB replica set outage “due to bad connection status”

I have a production replica set that went down for 3-4 minutes, apparently because the Primary could not connect to the Secondaries. I'm having a hard time understanding why a Secondary didn't take ...
0
votes
1answer
230 views

unable to add a range to a tag using sh.addTagRange command

Have setup a 4 node test shard cluster: 1- mongos 1- config server 2- shard nodes hosting 1 shard each for a collection. Cluster is working perfectly, but when trying to run the following command: ...
2
votes
1answer
3k views

Issues in starting MongoDB service

I've installed MongoDB 3.0 in RHEL 6. From root user, I'm trying to start the mongo service but it is getting failed and the log file is not getting updated as well. 2015-10-13T09:53:26.133+0530 E ...
0
votes
1answer
356 views

MongoDB Lookup Issue

In collection A, we have "batches" : [ ObjectId("56fccffbe7c9f9cf7634dbfe") ], and in Collection B, we have { "_id" : ObjectId("56fccffbe7c9f9cf7634dbfe") } Can we perform a lookup between ...
1
vote
1answer
314 views

Why does MongoDB extend FileSize if it is already 5x larger than DataSize

I recently had to assign more diskspace to my MongoDB 2.4.8 instance. This instance continually receives transactions, makes some updates and then deletes them after 3 months. I would therefore expect ...
1
vote
1answer
225 views

MongoDB 2d index query with an additional sorting field - performance issue

I have a compound index in a 2d and normal field: "key" : { "_meta.loc.coordinates" : "2d", "_meta.unifiedAt" : 1 }, Then I want to execute the following query with ...
0
votes
1answer
211 views

MongoDB Tag-Aware Sharding Workflow

I wonder the work flow of sharding cluster in Tag-Aware Sharding. --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3, "minCompatibleVersion" : 3, "currentVersion" ...
0
votes
1answer
27 views

How to use mongoexport in count?

I want to get the count of all rows in a single collection into an output file. What is the correct way of doing this Here is what I did but I am encountering an error. mongoexport --host 10.1.0.1:...
0
votes
3answers
528 views

MongoDB replicaset - Delay in election

I have local set up for 3 mongo DB instances with successful replica set. (1 Primary, 2 secondary). If I terminate Primary instance, one of the secondaries becomes Primary but its taking around 10 ...
0
votes
0answers
37 views

MongoDB concurrent update to same document is not behaving atomic

Currently, we have an orderId for which we give the benefit(posting) to the user. There are multiple events that can trigger benefit/posting. But the condition is that only 1 event should be triggered....
0
votes
1answer
206 views

How to create a MongoDB index with isodate?

I've create and index for a query and its running is less then 1 second to retrieve millions of rows, but as soon as I add greater than ISODATE, it doesnt use indexes anymore. the query is this one: ...
2
votes
1answer
443 views

Fastest way to move Collection from Sharded MongoDB Cluster to a another Sharded MongoDB Cluster

I have to move a MongoDB Collection (Size: 1TB+) from Sharded MongoDB Cluster to another[5 shards on both clusters]. During this operation, it is assumed that the accompanying program will be offline, ...
2
votes
2answers
3k views

MongoDB config replica failed connection after a few days running

I have setup a MongoDB shard cluster. It has three shard replicas, each replica has three mongo instances. And it has one replica of 3 mongo config servers. And one mongos. It works fine at the ...
0
votes
1answer
564 views

Mongodb 3.6.3 disappears after 2 weeks on centos 7 ec2 instance

My Mongodb has disappeared 2 times, after 2 weeks, over the weekend within a 4 week time period. I had a snapshot to recover from but I can't keep on recovering my db every 2 weeks. In an ec2 ...
0
votes
2answers
2k views

How to speed up MongoDB chunk moving between shards

On a MongoDB 3.6 in a replica set and WiredTiger engine we have a large collection with 7.7TB of data. We started to see severe performance issues (extreme CPU usage and slowdown of data replication) ...
0
votes
2answers
2k views

Access denied when connecting to mongosqld with MySQL

I'm trying to connect to my MongoDB using MySQL through mongosqld. I have mongosqld running with a config file that looks like security: enabled: true mongodb: net: uri: test-db auth: ...
2
votes
1answer
215 views

How to disable mongodb shell logs?

Whenever we connect to mongo thru shell, we get some logs. I just want the query result not the other logs except the failure message. Is there any way to configure that? MongoDB shell version v3.6.11 ...
0
votes
1answer
229 views

Fastest way to sync (or keep import) 3.5TB data from hadoop to sharded mongodb cluster

There are 3.5TB data in our hadoop cluster(yes on hdfs). And we have newly built a sharded mongodb cluster(the latest 3.x) with 3 mongos, 3 configdb and 3 shards(each shard has 1 primary and 2 ...
0
votes
1answer
2k views

mongodb setFeatureCompatibilityVersion command not found

I'm trying to upgrade my mongodb from 3.2 to 3.4 and I try to set the compatibility version by: db.adminCommand( { setFeatureCompatibilityVersion: "3.2" } ) But it says { "ok" : 0, ...
0
votes
1answer
103 views

Not authorized on test to execute command

Here is my code: mongoose.connect(consts.database, { useNewUrlParser: true, useUnifiedTopology: true, sslCA: consts.databaseCert, }); //... const user = await db.userModel.findOne({ ...
0
votes
1answer
310 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
118 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 ...
2
votes
1answer
471 views

How to disable ChunkManager logging for MongoDB? mongoconfig.log gets huge

I'm using MongoDB 3.4 for saving other systems logs and mongoconfig.log is getting too much verbosity. It's a sharded clusted, if that helps. I checked the default mongo log verbosity and is set at ...
0
votes
1answer
661 views

Mongodb Cross-region failover replication aws

I have deployed 3 MongoDB nodes(node-1, node-2, node-3) in AWS. The first two nodes (node-1, node-2) are deployed in Virginia region and the third node(node-3) is deployed in Oregon region and enabled ...
0
votes
1answer
324 views

How to use mongoexport command with ssl?

I am trying to export collection data from (SSL MongoDB 4.x), for this I am running below command on linux terminal. Earlier I used mongoexport command in Linux terminal without SSL which works ...
0
votes
1answer
1k views

Trouble connecting to local MongoDB server through app.js

I'm a newbie to MongoDB, and I just set up MongoDB within my Ubuntu terminal with mongod and mongo commands running in separate terminals. However, I can't get my app.js that would launch a website to ...
3
votes
3answers
5k views

Getting empty folder when using mongodump to back up my MongoDB

Basically, I have a problem with using mongodump to back up my MongoDB. This is the general syntax I use in SSH: mongodump -d myDatabaseName -o ~/backups/my_backup This is the resulting message: ...
0
votes
1answer
426 views

Database is not reflecting in sh.status()

I have a 2 shard (s1 and s0 )servers with repl set. s1 has 2 dbs (db-A and db-B) and one of the db is sharded (db-B). When i do sh.status() from mongos only (db-B) is displayed. I am wondering what i ...

1 2 3
4
5
45