Skip to main content

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

Increase security of mongodb-based flask/react applications?

this is the first time I use mongodb seriously, and I have a question about best practices when it comes to access. Say you have a typical mongodb/flask application. The users use the browser (via ...
Stefano Borini's user avatar
0 votes
1 answer
203 views

Better way to store panel data in SQL or NoSQL

I have an Excel of raw panel data (cross sectional + time series) sent to me by customers (I cannot change this). For those not familiar, imagine the gdp time series for each country. I need to ...
Dark2018's user avatar
  • 101
-3 votes
1 answer
619 views

MongoDB not logging to log file

mongodb at some point stops logging events in the mongodb.log. the mongod process results up. version Mongodb 4.4 Replica Set ( PSA ) linux operating system CentOS Linux release 7.9.2009 (Core). -rw--...
Mongoboy's user avatar
0 votes
2 answers
3k views

how to get mongodb current featureCompatibilityVersion into a variable with only version

how to get mongodb current featureCompatibilityVersion into a variable with only version instead of printing like this db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ) { "...
unknown's user avatar
  • 94
0 votes
1 answer
2k views

Unable to start mongod service in 5.0 and connect to mongoshell

Unable to start mongod service in 5.0 and connect to mongo shell: systemctl start mongod.service and tail the log, I see that process is getting killed. Not sure what has changed in 5.0, I tried ...
unknown's user avatar
  • 94
0 votes
1 answer
1k views

Do I need to split a 1.5 billion document database into several in a standalone MongoDB?

There will be total 1.5 billion documents in nearly 100 collections in one database. Need I to separate this database into several? Is there a performance limitation for a single database when the ...
zyeewang's user avatar
0 votes
1 answer
193 views

MongoDB: slow removeShard

I have a MongoDB cluster with 9 nodes (3 shards, 3 nodes each). I'm now removing one shard, but the process itself is running extremely slow. Each node of the shard being deleted stores ~400Gb of data,...
Pavel Sapezhko's user avatar
0 votes
1 answer
479 views

mongodb rs.status to list status of the node

the moment I use sed to replace node and port the quotes are removed and hence syntax error. Is there a different solution to this syntax error. NODE=abcd PORT=1234 mongo_cmd="mongo admin -u $...
Achar007's user avatar
0 votes
1 answer
465 views

What is this mongo index with field._ref.$id_1

I have a document in a Mongo collection which has an index as follows: field._ref.$id_1 This is tripping up a new database driver we're planning on using - it doesn't seem to understand this format, ...
Tom White's user avatar
5 votes
1 answer
4k views

MongoDB: specify a default sort order?

I'm using MongoDB v5. Most of my collections have temporal data, so each document has at least one datetime. Naturally I'm generally most interested in the most recent data, but by default mongo ...
Ian Newson's user avatar
1 vote
1 answer
779 views

Transition from MongoDB Time Series Collections to InfluxDB

With version 5.0 MongoDB's specialized Time Series Collections were introduced to deal with such data. As I already stored some sensor meta data (configuration, specification ...) in MongoDB, I ...
albert's user avatar
  • 113
1 vote
1 answer
53 views

Storing and Querying User Defined Data

I'm working on a system where each user defines a strongly typed definition of data they can store, consisting of classes with specified fields. Embedded classes are also supported. My first instinct ...
I_A's user avatar
  • 111
1 vote
0 answers
2k views

Using mongodump to dump all databases but exclude a collection

The mongodump tool seems not to support the option --excludeCollection=someCollection when not specifying the --db someDb option. We would like to dump just all databases without explicitly specifying ...
Andi's user avatar
  • 111
0 votes
0 answers
166 views

Does time cost of insert depend on the collection's size in MongoDB?

I've noticed that the inserts on my MongoDB are getting slower as the collection grows. The collection doesn't have any indexes. I wasn't able to find anything about this topic in the official ...
s.demuro's user avatar
  • 303
1 vote
3 answers
441 views

SQL or/with Nosql

I am designing a mobile app with basic functionality such as sign-up, Auth, posts, real time messages etc. I think for this kind of work Nosql should work better. But over a long period of time I want ...
Rajat Sharma's user avatar
0 votes
1 answer
3k views

Can't restore `mongodump` archivegz file with `mongorestore`

I generated a MongoDB dump file with the archivegz format. When I try to restore it with the mongorestore command, it won't restore. The command for restore mongorestore --gzip --archive="./...
behroozbc's user avatar
  • 101
1 vote
0 answers
91 views

Match, group and get percent of documents by a specific date in MongoDb

An exemple fo my data { "_id" : ObjectId("61cda8dabc3c3e648af34775"), "icone" : [ "pomme", "mangue" ], "is_good&...
Burnny Kibonge's user avatar
0 votes
3 answers
695 views

Should I use SQL vs NoSQL for files catalog? [closed]

I will be implementing a system which will be storing 250 Million files/user. I want to perform list operations from the client side, where the client application will be fetching 100 records at a ...
Anup Buchke's user avatar
1 vote
0 answers
34 views

How to structure MongoDB for multi-field query?

Right now, we have a Post collection that the users query based on their locale. The collection looks like this: Post { userId: String text: String locale: String ... ... } And a User ...
Sotiris Kaniras's user avatar
3 votes
1 answer
9k views

Chat schema for PostgreSQL and MongoDB

I'm designing a schema for a very large chat app. I had problems with NoSQL databases such as MongoDB and Cassandra. Some part of the schema is relational i decided to use both PostgreSQL and MongoDB ...
Jacqueline's user avatar
-1 votes
1 answer
122 views

Creating a database with authentication enabled on mongodb

I can create a database using a specific role for my "user1". I have tested and a user "test1" can not create a database in the mode authorization enabled. How works the creation ...
Rodrigo N M's user avatar
-1 votes
1 answer
566 views

Joining in NoSQL to get chat messages for a user

In my chat app i have private / group chats and I need to get messages for a user. Let me first explain the whole system. Messages: // group message { id: 1, text: 'hello', chat_id: 'AjK954_e5iP'...
Jacqueline's user avatar
1 vote
2 answers
2k views

How to count number of occurrences of each key in a MongoDB collection efficiently (one pass?)?

I'm a MongoDB noob and I have a MongoDB collection with millions of documents, each with tens of keys (average ~ 60, large variance) from a set of around 100. I'd like to get a count of each key ...
rickhg12hs's user avatar
0 votes
1 answer
546 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", ...
test1232's user avatar
2 votes
1 answer
330 views

Cannot connect to MongoDB router in sharded cluster

I followed this guide on how to setup a sharded MongoDB cluster with Docker containers. It all seemed to work as it should because there were no error messages in the logs and the sh.status() command ...
Tobias S.'s user avatar
  • 131
3 votes
3 answers
6k views

Add an arbiter to mongodb ReplicaSet failed

I am new to mongodb and this is my second post in order to build a test cluster and gain knowledge at the same time. I have a 3 nodes cluster holding server MONGO2, MONGO3 and MONGOARB1. MONGO2 and ...
Mickael's user avatar
  • 325
0 votes
1 answer
1k views

update datatype field int to decimal128 in mongo db in nested json structure

Hi have tried to updated nested field datatype db.test.find().forEach(function(data){ data.age = NumberDecimal(data.age); data.phone.$.mob = NumberDecimal(data.phone.$.mob); db.test.updateOne({_id:...
test1232's user avatar
0 votes
1 answer
86 views

What could be the better Database to make a book reader one or more books? [closed]

I am thinking about a personal book reading mobile app project. I have a total of 13 different books. Each book has 10 chapters and each chapter has its own content. It should have the feature of ...
Suresh Pokharel's user avatar
1 vote
5 answers
9k views

MongoDB : How to Convert a Standalone to a Replica Set

I am new to MongoDB and searching for several hours how to promote my mongo standalone instance into a replicaset. My actual environnement is one ubuntu server root@UMONGO1:/home/msc# lsb_release -a ...
Mickael's user avatar
  • 325
0 votes
1 answer
1k views

question on mongodb oplog usage

One of my secondary on a PSS replica set (v4.0.4) always goes out of sync after it tries to rollback automatically after local.oplog.rs collection cleans up on the secondary. Question Though I've ...
Achar007's user avatar
0 votes
0 answers
997 views

How to identify why mongo cluster crashed

I have Mongo 4.4.10 running on Debian Linux. There is a replica with three nodes. There is no load at all as I am in beta mode yet. But I realized that two nodes have crashed. I cannot find any error ...
Leos Literak's user avatar
1 vote
1 answer
260 views

Is there a generator to create a table in MongoDB just like in Laravel?

I'm a newbie in mongoDB, and I just would like to ask a simple question. In creating tables in MongoDB, do you go ahead in MongoDB compass and create the fields in a collection, or is there a command ...
Jumar Juaton's user avatar
0 votes
1 answer
58 views

Mongo DB Query does not give desired result

I have two collections in mongo db. One called list with keys id and movieid in it. One called movies with movieid and Genre in it. The results I am trying to retrieve are: Which listid has the ...
abc's user avatar
  • 1
0 votes
2 answers
1k views

Significance of $$ in MongoDB

I was recently given this snippet of code that generates an arbitrary document in MongoDB. I've never encountered $$ in Mongo before and I'm curious about its significance. All I know is that if I run ...
cramos24's user avatar
0 votes
0 answers
153 views

How to specify a sync source when adding a new member to a MongoDB replicaset?

Recently we had a machine physically destroyed, so our replicaset is now: Primary - Secondary - Arbiter (250G on disk, 20G (70hrs) oplog). So, I'm trying to add a new member (4.4.10) to the replicaset ...
Balbuzar's user avatar
0 votes
1 answer
49 views

Mongo node with smaller priority has not stepped out

I have a three nodes replica and I prefer a 10.0.0.5 as a primary. I have just realized during a performance test that 10.0.0.2 is primary instead. I thought it should have step out automatically ...
Leos Literak's user avatar
0 votes
0 answers
375 views

MongodB CPU and memory utilization is low yet queries taking time to execute

I have 3 replica set instances running on different machines. Primary has CPU utilization of 20% and memory usage of 50% yet sometimes there are spike in in random queries which takes several seconds ...
TubbyStubby's user avatar
0 votes
2 answers
271 views

can we use one arbiter server in two different replica sets of MongoDB?

can we use one arbiter server in two different replica sets of MongoDB? I had one replica set with one master one slave and one arbiter server so want to use the same arbiter server in another replica ...
Abhishek's user avatar
0 votes
1 answer
234 views

Unable to join arbiter to a replica set

I'm trying to add a arbiter to replica set. Unable to join arbiter to a replica set. port is listening - netstat -an | grep PORT tcp6 0 0 :::PORT :::* ...
Achar007's user avatar
0 votes
1 answer
2k views

MongoDB TLS unable to get issuer certificate

I'm setting up a MongoDB server, and wanted to use TLS from a proper CA and DNS. I got a domain name and put an A record in, linking to my server. Afterwards, I applied for a SSL certificate on ...
mosfeta's user avatar
0 votes
1 answer
390 views

Creating a copy of a mongodb replica set

I have a mongodb replica set (1 primary, 2 secondary instances): vm1, vm2, vm3. I had a need for a second replica set so I created a copy of the above vms: vm4, vm5, vm6. After booting up vms[4-6] ...
spk's user avatar
  • 3
0 votes
0 answers
2k views

GroupBy with count array in MongoDB

I have a collection and object where this object has a list of objects as following: { "_id": { "$oid": "615617f5b0cd1765b7ba21c1" }, "response": { &...
سجاد أحمد's user avatar
0 votes
1 answer
463 views

Mongodb continuous schedule and cancel catchup takeover on replica set member

We have a mongodb 4.2 (stable branch) replica set with three members. It was working for several months without problems. Yesterday one of the secondary members started to do very strange things. I ...
nagylzs's user avatar
  • 411
0 votes
1 answer
1k views

MongoDB in M1 Mac: 'mongod' command doesn't work

I'm totally new to mongodb and has no knowledge about it at all. So I just followed installation guides in the internet, but after installation 'mongod' command doesn't work and shows these lines... {&...
user avatar
0 votes
1 answer
554 views

parse json into a relational database or use a NoSQL?

I am retrieving a JSON file from an API which size varies between 100kb to 7mb. The structure of the response is: I initially thought in storing the response in a relational database, with the ...
Manza's user avatar
  • 103
0 votes
0 answers
327 views

aggregation with group by, inner join and nested conditions in MongoDB

First of all I am sorry if this is a basic question, I am new to queries in MongoDB. Well, what I need is to find the latest registers for a worker in my WorkerLocationContext document and the latest ...
liegolas's user avatar
0 votes
0 answers
252 views

Downsides of creating new collections for the same data in mongodb

My app saves alot of data from different companies on the same format, is it better perfomance wise to have a single collection and separate them by a companyId key or to have multiple collections ...
beto's user avatar
  • 1
1 vote
2 answers
43 views

Best way to study a new type of database if you are experienced in another type

Does anyone have a good approach to learning a new type of database when they already are proficient in another one? I have thought about writing notes to myself about how to do various tasks that I ...
Bobby Durrett's user avatar
0 votes
1 answer
108 views

mongodb write issues

We have 5node replicaset , in which 2 servers are in Jacksonville datacenter and 2 servers are on Atlanta datacenter and an arbiter . I had brought down the Atlanta servers , but the write operations ...
Fahed B Ashraf's user avatar
0 votes
1 answer
874 views

Is ObjectId as shard key unique across shards or just within a shard?

In my sharded cluster of version 4.2, one collections is sharded on _id where _id is just a default ObjectId. I'm seeing multiple documents with same _id on different shards' primaries. When I specify ...
corgicorgi's user avatar

1
3 4
5
6 7
49