Questions tagged [mongodb]

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

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

Is there a way of identifying transaction boundaries from MongoDB ChangeStream?

The MongoDB documentation (https://www.mongodb.com/docs/manual/reference/change-events/) specifies that for a change event, the transaction associated with that event can be uniquely identified by the ...
Kiruphasankaran Nataraj's user avatar
0 votes
0 answers
35 views

Adding view to mongodb creates malformed archive

Yesterday I added a new view to a mongodb 6 database. The view itself works but when I tested the backup archive today with mongorestore on a different machine/database I got Failed: restore error: ...
Lucius Cato's user avatar
1 vote
1 answer
205 views

Product Object for Ecommerce in NoSQL

I'm working on an ecommerce app that will be using a NoSQL document database. I want to have a general purpose product that can be used for different types of products, ranging from coffee to ...
Sam's user avatar
  • 113
0 votes
1 answer
244 views

How to restore Mongodb db with collection.wt and index.wt files

I have collection-0-xxx.wt and index-0-xxx.wt files simply copied from another dbpath. I am wondering if those files are enough to restore the data in MongoDB. If yes, how can I do that? If not, what ...
zurich_ruby's user avatar
0 votes
2 answers
489 views

Why did writes stop working when a secondary in my replica set went down?

I have a MongoDB replica set with 3 nodes and 1 arbiter. The nodes have priority 0, 1, and 10. The arbiter has priority 1. They all have 1 vote. The priority 10 was PRIMARY, while the priority 0 and 1 ...
Claudiu's user avatar
  • 101
0 votes
0 answers
46 views

This is a question about how to recover mongodb composed of shards

The current situation is that the db is corrupted by killing and raising the process using linux command kill rather than the normal method of mongodb. If I had used the shutdown command, it would not ...
han's user avatar
  • 1
2 votes
0 answers
2k views

MongoDB Find query returning error, no idea why

I am learning MongoDB by myself. I am following all the official guides as well as watching videos and I am practicing on a movie database. Each document has an array "crew" with a "...
Carlo's user avatar
  • 21
0 votes
0 answers
356 views

Application can't connect to MongoDB server through IP address

I have a java application that connects to mongoDB 4.0.2 replicaSet with one node (Primary). I upgraded the database to mongoDB 4.2.20. Even though, after making tests I decided to downgrade to 4.0.2. ...
user3637971's user avatar
0 votes
0 answers
74 views

MongoServerError: Document failed validation

I have this collection on Atlas Mongodb. I am testing updating the records in this collection using the mongosh tool on Ubuntu Focal Fossa and it previously worked on my work network but now produces ...
George Udosen's user avatar
3 votes
1 answer
238 views

WiredTiger Page Size

I'm unable to find out if there is a pagesize in a WiredTiger MongoDB storage engine. I mean some analog of the innodb_page_size for MySQL.
Pavel Sapezhko's user avatar
1 vote
1 answer
6k views

MongoDB :: using String instead of default ObjectId type for _id?

There is this question which asks essentially the same question but is three questions in one and the 1/3 I'm after isn't really answered very well so I'm asking it again: I'm starting an new MongoDB ...
spinkus's user avatar
  • 121
0 votes
0 answers
2k views

Can not start MongoDB community edition on Mac

Following Install MongoDB Community Edition on macOS: Started like this: brew services start [email protected] no error was raised, but when I do: brew services list kukodajanos@Kukodas-MacBook-...
János's user avatar
  • 101
2 votes
1 answer
29 views

Does hidden priority-0 replica count when calculating fault tolerance?

We have a mongdodb cluster with 3 replicas in one. We are planning to add one more replica on cloud. The replica on cloud is set as hidden and priority-0. If we include the hidden the total no. of ...
codebuddy's user avatar
3 votes
1 answer
50 views

Manually change hidden node to primary when all other nodes fail

We have a setup MongoDB cluster that consists of a total of 5 nodes of which 3 are on-premise and 2 nodes on cloud server. We have configured 2 nodes on cloud servers to be hidden and priority-0 to ...
MapSec's user avatar
  • 31
0 votes
0 answers
27 views

How can I prevent UX issues caused by a document that references another document changing?

I have a web application that utilises two collections in a MongoDB database: Ingredients Recipes An example of the problem A chef creates a new recipe, which is added to the Recipes collection. ...
Check12's user avatar
  • 53
2 votes
1 answer
26 views

MongoDB operations rate by collection

Is there a way to get an operation count/rate by collection or database? I know about mongotop command, but it's quite different. Also, it seems collStats has no information I am looking for.
Pavel Sapezhko's user avatar
1 vote
1 answer
25 views

Run mongoimport in a complete isolation

We planning our data migration from one standalone server to other standalone server. (we can't use replication due to some constraint) We had used fsyncLock() and fsyncUnlock() to ensure complete ...
Noobie's user avatar
  • 165
1 vote
1 answer
698 views

Mongodb replica stuck at STARTUP

I have 4 Servers: Mongo1(with secondary and arbiter), Mongo2(primary). Mongo3, Mongo4 Mongo1 and Mongo2 were initiated and successfully running for months. (1 and 2 + arbiter are connected over the ...
AATHITH RAJENDRAN's user avatar
0 votes
0 answers
99 views

Accidentally drop of collection on shard of sharded MongoDB cluster

I have accidentally triggered a drop collection command on one replica set (primary-shard) of a MongoDB sharded cluster (no secondary shards). Unfortunately now I can not access the data of this shard ...
honigbrot's user avatar
0 votes
0 answers
182 views

mongodb - composite shard key involving identifier and date

We have a collection of data which records the activities performed over a range of time period. the fields of importance are userid and created_at many of the users are pretty important in our system ...
asgs's user avatar
  • 67
0 votes
1 answer
441 views

Help required to find correct MongoDB size

Please help me to find correct MongoDB size. db version v3.4.10 I have also executed below command to check if there are any ghost file. The below command output is zero. lsof | grep deleted | grep ...
Sridhar G's user avatar
0 votes
1 answer
53 views

How to optimize index if expected result is limited to 50k?

I have a collection where we are checking the recently active 50k users. The collection has around 1m data. And the query that we are using is this: db.getCollection("UserLastActive").find({ ...
JRA's user avatar
  • 129
1 vote
0 answers
453 views

Why when a Mongodb second secondary node is unreacheable, the cluster is affected?

I have the following MongoDB 4.0.2 cluster with the following information: rs.conf() { IP:192.168.1.26, // Primary, in New York branch priority:10 }, { IP:192.168.1.24, // Second Secondary, in ...
user3637971's user avatar
1 vote
1 answer
104 views

How to find out what kind of database( SQL vs No-SQL) is better to use for a specific service/server? [closed]

I am trying to learn microservices and write a project based on microservices, but I don't know how to choose the right database for each microservice? Based on my researches MySQL and PostgreSQL are ...
GoodMan's user avatar
  • 111
1 vote
2 answers
239 views

Why MongoDB occurs OOM every few days

My Server Info AWS Ubuntu 18.04 MongoDB 4.2.17 4 Cores 16 GRAM This server only running mongodb, and allocated 10G memory to mongodb wiredTiger: engineConfig: cacheSizeGB: 10 But this ...
ikool's user avatar
  • 11
0 votes
1 answer
146 views

The most efficient way to query a growing collection/table

I'm asking this question for both SQL and NoSQL implementation as the principle is the same and I'm curious to hear peoples' thoughts (I'm a beginner who is curious about both, particularly MongoDB &...
user8758206's user avatar
0 votes
1 answer
179 views

Can we do incremental sync of MongoDB based on a schedule?

Can we sync a mongodb database to another incrementally based on a schedule? Say, once every night at 12 am? Background: We have a MongoDB replica cluster consisting of 3 instances, all located within ...
esafwan's user avatar
  • 133
0 votes
1 answer
165 views

Save food dishes: MySQL or MongoDB?

What would be the best database system to store a lot of food dishes. Knowing that a dish can have variations. A small pizza is cheaper then a large pizza. And if you for example want extra olives on ...
O'Niel's user avatar
  • 111
1 vote
1 answer
164 views

How do you create an atlas user in a non-admin db?

There doesn't seem to be an option in mongo atlas UI to create a user in any database other than admin.
Sudh33ra's user avatar
  • 111
1 vote
0 answers
372 views

mongodb connections current vs active

When I use the command 'db.serverStatus().connections' I don't understand the meaning of 'current'. The documentation defines it as 'The number of incoming connections'. Doc My application is a chat, ...
TomYJerry's user avatar
-1 votes
1 answer
69 views

How to store data in two separate mongo db server

I have application which uses mongo db currently I have one instances of mongo db server in my first data center in my another data center I have second mongo db instances what I want to archive is ...
Code poeter's user avatar
0 votes
1 answer
513 views

MongoDB 4.4.3 ignoring `wiredTigerCacheSizeGB` limit in Kubernetes

We currently have the memory limit set up in Kubernetes for mongo using the below: - name: MONGODB_EXTRA_FLAGS value: --wiredTigerCacheSizeGB=6 And we verified that it's been parsed with ...
Pat's user avatar
  • 117
0 votes
1 answer
67 views

Can oplog be put in a different disk partition?

I'm just curious if this is possible. Coming from mysql, the log_bin can be put on a different disk.
JRA's user avatar
  • 129
1 vote
0 answers
224 views

I'm getting random "Plan executor error during find command" errors

My max time for queries is 2secs (2000ms). However when I try to manually query the script, there is nothing wrong with the query as it finishes executing after 0.002 secs. I've checked my server ...
JRA's user avatar
  • 129
0 votes
0 answers
67 views

Schema design for tracking the gaz prices in MongoDB

I would like to build an app that give the ability to search for the cheapest gaz price around Display the gaz price trend whether it's up or down.(similar to the stock price) The data source are ...
john doe's user avatar
0 votes
1 answer
995 views

secondaries not replicating data from primary due to some HMAC issue

Has anyone faced this issue ? Unable to re-sync replication either deleting the data directory & starting or doing rsync. Is this a bug ? What component in mongodb this "monitoring-keys-for-...
unknown's user avatar
  • 94
3 votes
2 answers
9k 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 ●...
yupthatguy's user avatar
0 votes
2 answers
68 views

Is it possible to have 2 arbiter on a replica set on my setup?

I am trying to upgrade mongodb from 4.4 > 5.0 I have a 2 separate replica set (replicaset1, replicaset2) which hosts different platform on our site. replicaset1 setup: (mongodb version 4.4) rs1VM1 (...
JRA's user avatar
  • 129
3 votes
3 answers
6k views

MongoDB install on ARM?

I'm working to install Mongo on an arm64 machine with no success. Any ideas on what I'm missing? I'm following the steps defined at: https://www.mongodb.com/docs/upcoming/tutorial/install-mongodb-...
Rajesh's user avatar
  • 31
0 votes
1 answer
125 views

Does pagination allow MongoDB to query faster?

const result = await strapi.query("model").find({ id: id, _start: page > 0 ? (page - 1) * pageSize : 0, _limit: pageSize, _sort: "created_at:desc", }); ...
Sayaman's user avatar
  • 201
0 votes
1 answer
634 views

mongodb use _id field as shard key for time seires collection

I've successfully created and deployed a self-managed MongoDB cluster that consists of 3 shards,1 router(mongos), and 1 config-server replica set, using this tutorial. I want to create a shareded ...
Eliav Louski's user avatar
1 vote
1 answer
394 views

How to implement disjoint (nonoverlapping) subtype with total completeness in MongoDB?

I designed an entity relationship diagram (ERD) with the goal of creating two child entities (INSTITUTION and SPACECRAFT) of a parent entity (LOCATION), which is distinguished depending on the value ...
ttoshiro's user avatar
  • 113
1 vote
1 answer
806 views

How to update mongodb configure at Docker?

I am unable to enable security parameter at docker of mongodb at mongod.conf file. So how can I configure any parameter at mongod.conf file? I found a file inside mongodb container named it as mongod....
Sheikh Wasiu Al Hasib's user avatar
2 votes
2 answers
2k views

Upgrade a large mongodb database from 3.6 to 6

I have a mongodb 3.6 database with about 7TB of data, and wish to upgrade this to 6.0. It is a very basic db with no replicas, no sharding, etc. Downtime is not an issue - it can be down for days. I ...
fso4242's user avatar
  • 61
0 votes
1 answer
207 views

MongoDB OplogStart Missing

I understand that some times MongoDB secondary data becomes stale at which point, we need to perform an init sync from the Primary instance. But sometimes we see error logs that look like this: 2022-...
Vineel's user avatar
  • 103
0 votes
2 answers
879 views

Why MongoDB doesn't allow to connect with the database specified?

I installed MongoDB 4.4 on Ubuntu 20.04. Then, I created a user: $ mongo use admin db.createUser({user:"admin",pwd:"foo",roles:[{role:"userAdminAnyDatabase",db:"...
yegor256's user avatar
  • 103
-1 votes
1 answer
168 views

MS SQL Server Express alternatives, choosing between Relational-DB / NoSQL [closed]

This question relates to choosing the best database storing data on a pc running windows. The pc is part of a commercial product which generates a big amount of data over time. Data consists of Test ...
Basti's user avatar
  • 177
0 votes
0 answers
221 views

Are there any unintended side effects of limiting a mongodb docker container's CPU or RAM?

It's easy to limit RAM and CPU usage for a docker container with the docker update -m command. We have limited RAM and CPU using docker update on multiple docker mongodb containers, particularly on an ...
J.E.C.'s user avatar
  • 101
0 votes
1 answer
199 views

What is the meaning of replan:true, truncated:command?

This a command I saw in mongod.log while there are CPU spikes on our VM. What is the meaning of replan:true? And the replanReason: cached plan was less efficient than expected...... As seen from the ...
JRA's user avatar
  • 129
1 vote
1 answer
212 views

Enable remote access to database via proxy server

What's the most painless way to create something like a proxy server so that my dev team can access a database from anywhere? The server in question is a managed MongoDB database. Currently, I am just ...
Anson Kao's user avatar
  • 111

1 2
3
4 5
48