Questions tagged [mongodb]

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

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

Update data type from integer to decimal128 for all document having nest array in mongo db

Had a JSON structure which is having nested array and need to update all data type for that json structure [ { student: [ { name: { firstName: "Rahul", ...
0 votes
1 answer
20 views

Testing a BinData field by $bitAllSet with an offset and size limit in MongoDB

Assume I have a BinData field of arbitrary length that stores n-byte items. The offset of each item is known before the query and all items are n bytes. I want to test an item at offset X with bitmask ...
0 votes
1 answer
8 views

Why is my 4-node replicaset setup is not working?

I have a 4 Node setup which is being hosted On-Prem by 2 Host Servers (DC1, DC2) 192.168.0.1 - Primary (Located in DC1) 192.168.0.2 - Secondary (Located in DC2) 192.168.0.3 - Arbiter (Located in DC2) ...
1 vote
1 answer
279 views

Allow connection to mongo only from my server droplet

Recently I created a server with MongoDB preinstalled on a DigitalOcean droplet following these tutorials DigitalOcean - Initial server setup DigitalOcean - How to secure MongoDB on Ubuntu Medium - ...
3 votes
2 answers
2k views

Choosing the right database for stock price history

The model is [(stock_id, period, ts), open, high, low, close, last, volume] We write new prices for all stocks (120,000) each minute and delete old once when they go out of retention time. It doesn't ...
0 votes
1 answer
518 views

In MongoDB serverStatus(), what is the meaning of "connection data handles currently active"?

When running db.serverStatus() in the MongoDB shell (3.4, WiredTiger), the results contain the following data: { "connection data handles currently active" : 94862, "connection sweep ...
0 votes
0 answers
7 views

MongoDB - optimizing compound index by using executionStats

I am visiting the MongoDB learn DBA course. In one of the labs, it was shown how to optimize the compound index by examining the explain plan. The lab used the sample training dataset. Following query ...
1 vote
2 answers
601 views

Assigning multiple IP addresses to MongoDB 7.0 on Ubuntu

The Problem I am trying but failing, in MongoDB 7.0, on Ubuntu, to bind multiple IP addresses to net.bindIp in mongod.conf What I have tried I have tried 127.0.0.1,x.x.x.x, 127.0.0.1;x.x.x.x, [127.0.0....
1 vote
1 answer
2k views

How indexing on a date field that is constantly updated and or omitted affect performance?

In MongoDB, I have a collection with a date field called last_updated I would like to index. Reason being, I am often querying on a date range of that field in addition to sorting by that field and ...
2 votes
1 answer
2k views

MongoDB Using String-Type Shard Key for Zone Ranges

Mongo lets any field type be used to set ranges for Shard Zones, but doesn't specify how analyses are conducted. My goal is to point queries and writes at the exact right server, WITHOUT using a ...
0 votes
1 answer
3k views

mongodb set feature compatibility to 3.4 fail

I want to enable the features of my Mongodb 3.4 after upgrading. I have sharded cluster enviroment And after I ran the commands: use admin db.adminCommand ({setFeatureCompatibilityVersion: "3.4"}) ...
1 vote
2 answers
3k views

mongodb conf node won't start - compatibility error

I recently upgraded a dev sharded-cluster from 3.6 to 4.0 - one of the conf servers is now failing to start: 2020-01-30T13:19:02.972-0600 F CONTROL [initandlisten] ** IMPORTANT: UPGRADE PROBLEM:...
1 vote
2 answers
3k views

Mongo: how to covert a string to decimal?

I have written millions of documents with $CURRENT_CASH_BALANCE as strings instead of decimals. How can I convert them all to decimals?
0 votes
1 answer
23 views

MongoDB Delete old data

We want to clear our Mongo of old records (older than 90 days), we have a replica set with 3 nodes and we have 3.8 terabytes of data (in /var/lib/mongodb) on each node We want to clear old records ...
0 votes
2 answers
647 views

MongoDB covered query needs to fetch and examine documents when exists operator is used

I need to execute following query on mongo db: db.testCollection.find({ dataType: { $exists: true } }, { _id: 0, date: 1 }) .sort({ date: -1 }) .limit(1) so basically only I need to do is to ...
1 vote
1 answer
910 views

MongoDB is not using the index I created for this specific query

MongoDB 4.0. I have a simple query: db.product.find({ modifiedOn: { $gte: ISODate("2019-08-02T03:00:00.000Z") } }) .limit(10) And a simple index on modifiedOn....
0 votes
2 answers
442 views

Can MongoDB manage balancing between the Mongos Dynamically using TCP Balancer

If I have a business where I maintain 10 applications and I need to divide the request load of these 10 applications between 3 Mongos Dynamically. Like the TCP Loadbalancer need to connect to MongoDB ...
0 votes
1 answer
16 views

Mongod starting issue on ubuntu

When I try to check the status of mongodb I get the following: × mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled) ...
user avatar
4 votes
2 answers
20k views

Is it possible to delete cache in Mongo?

My case is that I run several queries in Mongo and measure the response time. I know that Mongo uses Memory Mapped files and cache some data in RAM. If I create an index and run a query the execution ...
0 votes
0 answers
8 views

How to employ peer-2-peer connections with Flutter (and MongoDB)?

I'm tinkering with the idea of making a Flutter application which uses MongoDB as the database. Since I especially want to use a database optimized for mobile usage, I thought MongoDB including ...
9 votes
2 answers
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 I can't seem to get it to successfully start the balancer backup after everything's all said and done. Here's ...
0 votes
1 answer
12 views

How to mongodump collection with x days behind?

I'm trying to mongodump one specific collection but I need only 90 days behind. I'd to accomplish something like this: db.collection.countDocuments({dateStart:{"$lt" : Date.now() - 90*24*60*...
0 votes
0 answers
9 views

MongoDB Schema Design for Branch-Specific Flower Customization without Disrupting Original Data Flow

Description: I'm working on a MongoDB schema design for a flower shop application where flowers are managed at both the company (flower type) and branch (flower) levels. Each flower type is defined at ...
user avatar
1 vote
1 answer
652 views

mongodump: fact.bson: input/output error

We are trying to export 1.5TB database into mongodb. But its fail after 100gb and giving us below error. As we notice root mount point got 100% space. We are using below command: mongodump -u admin -...
0 votes
1 answer
2k 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 ...
3 votes
2 answers
11k views

MongoDB Won't Start Due to Core Dump

I have MongoDB 5.0.11 on Ubuntu 20.04 server inside of Virtualbox6.1. It has been humming along for months, but suddenly the mongod.service has refused to start. root@test:~# systemctl status mongod ●...
2 votes
1 answer
1k 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 ...
-1 votes
0 answers
14 views

How should I design my mongo database having multiple buy/sell orders and requires summary of the orders?

I am using MongoDB to design somewhat like an inventory management system where a user can place orders for multiple items. These orders can be BUY or SELL orders along with the quantity and price. My ...
1 vote
1 answer
277 views

How to figure out what's happening with mongodb?

I am facing an issue where our primary instance of mongodb shows high memory consumption every night. & i was going through the metrics and could see the cache size being reduced and used memory ...
-1 votes
0 answers
50 views

Exactly how bad or good mongo 6.0/7.0 vs 3.4 performance-wise? Is it worth upgrading?

I'm currently using a 3.4 version and has been contemplating an upgrade for some time. However, after researching the performance implications of an upgrade to 6.0 I became quite uncertain about doing ...
1 vote
1 answer
4k views

UserNotFound mongodb error

I know there are lot of articles with the same issue and I explored every other article trying everything and still this error persists. Here are the steps I followed: use admin. created an admin ...
0 votes
1 answer
13 views

Hi , Need support to decompose Mongo DB dump - > Then re-construct that again

I am taking Mongo DB Dump from a production server where we have some limitation on file size which can be transferred from production to local environment. So we are planning to 1)Take Mongo DB Dump ...
0 votes
0 answers
11 views

Zero Access Encryption on AWS, Azure or Google Cloud possible with MongoDB?

I'm having a question about the following: is it possible in general to store data on a cloud platform, specifically either AWS, Azure or Google Cloud, without the cloud provider itself being able to ...
1 vote
1 answer
1k 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 ...
4 votes
4 answers
8k 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: ...
1 vote
1 answer
441 views

MongoDB Container Connection Hangs with no Response

This is my first time trying MongoDB. I'm just trying to simply connect to it successfully. I'm following the W3 tutorial here: https://www.w3schools.com/nodejs/nodejs_mongodb.asp docker-compose....
3 votes
1 answer
812 views

MongoDB sharding by monotonic id with zones for archiving

Situation: I have an ever-growing collection of documents which do have monotonically increasing unique id. All queries are direct lookup for documents with specified _id (no range queries nor ...
1 vote
1 answer
720 views

Compression in MongoDb 3.2 does not work

I installed MongoDb 3.2, and configured snappy compression in mongodb configuration file: engine: wiredTiger wiredTiger: engineConfig: cacheSizeGB: 99 ...
0 votes
1 answer
1k views

MongoDB Aggregate Poor Index Usage

I've been trying to understand the MongoDB Aggregate process so I can better optimize my queries and I'm confused by usage and $match and $sort together. Sample DB has only one collection people [{ ...
1 vote
1 answer
682 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 (because I enabled directoryperdb). Then I set up another machine to make them as a replica set. ...
0 votes
2 answers
326 views

Not able to shard collection

I have enabled sharding using the below commands. mongos> use news switched to db news mongos> sh.enableSharding("news"); { "ok" : 1, "$clusterTime" : { ...
0 votes
1 answer
29 views

Sharded Cluster - Why does my data not splitted among nodes?

I created a cluster with two shards. Or so I thought. In my design, first server has mongos_router shard1 (3 nodes) and config servers. Second server only has shard 2 nodes. After I configured shards ...
1 vote
1 answer
18 views

Mongo Preventing access to dangerous command

Reading Mongo: Definite guide: In first chapter, author mentions the following snippet to change some of the default commands of db: var no = function() { print("Not on my watch."); }; //...
1 vote
2 answers
2k views

Query using $gte and New Date() working in MongoDB shell but not through python pymongo

When I run the following in the mongodb shell, it returns the correct number of records: (searching for the matching "SourceName" within the last 8 days) mongos> db.fdl.count({ SourceName : "SRC1"...
2 votes
1 answer
456 views

Is there a way for mongodb clients to connect to mongodb server (SSL/TLS enabled) without client certificates?

I am trying to setup a MongoDB with SSL/TLS enabled. I'm just wondering is there a way for clients to connect to my mongodb server without having a client certificate that would not compromise the ...
2 votes
2 answers
372 views

Efficient way to store geographical routes in MongoDB

I need to store a taxi route into MongoDB, however I'm not sure what is the best way to do this. Since the route is only needed for the taxi order, the first idea I had is to store it in the order, ...
0 votes
1 answer
325 views

Mongostat display size / res

I would like to have your opinion and of course an explanation on the following. My configuration : mongodb version 3.4.4 1 replicaset with three identical servers( 4 cpu / 32 Go RAM under linux ...
0 votes
1 answer
431 views

using mongorestore for a db present in my computer

I just started using mongodb so my question might be a little basic. I have a folder with the collections I want to restore(this was a zip file I downloaded from my email). How do I use mongorestore ...
2 votes
1 answer
1k 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
0 answers
10 views

mongod --storageEngine=mmapv1 is failing

Just started learning MangoDB with the above command which is failing and giving below results. mongod --storageEngine=mmapv1 Please help me to fix this issue and proceed with my learning and ...

1
2 3 4 5
49