Questions tagged [mongodb]

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

Filter by
Sorted by
Tagged with
-1 votes
0 answers
5 views

best way to add/delete items in a mongoDB

I have an entity to which there are some children items. Now when i am editing the entity i can either new child or delete old child elements. for eg: initially let's say there are children A, B, C. ...
user avatar
  • 99
-1 votes
0 answers
6 views

Trying to find "magic combinations" in MongoDB

I have two MongoDB collections in a database named "records". Here's a sample document from the first collection: course_completions { "_id" : NumberInt(12345), "...
user avatar
0 votes
0 answers
20 views

how many databases can i make on a single mongodb replicaset cluster

I have a mongodb replicaset with 13000 tiny databases ( < 10 Mb ) This is now running on mongodb5.0 I restarted today to set the replicaset name This is taking for ever I get lines like {"t&...
user avatar
  • 101
0 votes
1 answer
16 views

how to convert mongodb db.currentOp() into json

I want to create an interface for all running processes in Mongodb How can I convert mongodb db.currentOp() output into json so that I can access that The output currently is a BSON string and I ...
user avatar
  • 101
0 votes
1 answer
13 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 ...
user avatar
0 votes
0 answers
38 views

Which database / search engine for filtering application

I've asked the question on here: https://stackoverflow.com/questions/71819288/mongodb-vs-elasticsearch-indexing-parallel-arrays But, I didn't get any answer. I believe here it's the right place for ...
user avatar
0 votes
1 answer
38 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 ...
user avatar
-4 votes
1 answer
21 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--...
user avatar
0 votes
2 answers
39 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 } ) { "...
user avatar
  • 94
0 votes
0 answers
12 views

Why do queries get stuck on single shard of mongodb cluster and disappear when i stepdown

I have a 15 shard mongodb PSS cluster with huge traffic approx 1TB per shard data I have seen that the queries get piled up on some shards which I find using db.currentOp on the mongos server. I do ...
user avatar
  • 101
0 votes
0 answers
55 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 ...
user avatar
  • 94
0 votes
1 answer
40 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 ...
user avatar
0 votes
0 answers
18 views

Errors in mongos after changing config server

Replaced config server by https://www.mongodb.com/docs/v4.4/tutorial/replace-config-server/, now we are seeing problems from mongos server. It can be seen from the log that the mongos server tries to ...
user avatar
0 votes
0 answers
10 views

Attempting to remove Object from a Array where an attribute matches the value passed through the query

I am attempting to write a query that removes the element from the array based on the messageId associated with said object in the array. This is submitted through curl hence the formatting, I've ...
user avatar
0 votes
1 answer
39 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,...
user avatar
0 votes
0 answers
19 views

questions related to mongodb timestamp and mongodump with oplog

mongodb replica set is PSS: d1node - SECONDARY d2node - PRIMARY d3node - RECOVERING mongo ... --host=d3node --port =1234 mongo1234:RECOVERING> rs.printSlaveReplicationInfo() source: d1node:...
user avatar
  • 94
0 votes
0 answers
26 views

mongod replica set state change on secondary node when resyncing from healthy node in PSS architecture

In a PSS architecture ? Question1 Are there a possibilities to get estimation of replication state change from ? <STARTUP> To <RECOVERING> <STARTUP> or <RECOVERING> To <...
user avatar
  • 94
0 votes
1 answer
35 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 $...
user avatar
0 votes
0 answers
40 views

What could cause "spikes" of slow queries in MongoDB?

I operate a fairly busy HTTP backend over a MongoDB cluster consisting of a primary instance and two secondary nodes. Most commands and queries are served by the primary DB node, and on the surface, ...
user avatar
  • 101
0 votes
0 answers
24 views

The amount of mongodb log is generated excessively

I’m using mongodb 3.6.8 for log collection. I want to get only slow query and error level logs. I set profilinglevel to (1, 5000), loglevel to 1 for queries only and 0 for everything else. However, ...
user avatar
0 votes
0 answers
13 views

Older version of Mongo compass gives exact collection while new one does not

On version 1.29.4 of Mongo Compass I am presented with a document count of collections as soon as I click on a DB along with other overall stats. But on version 1.30.1 I only get a figure like 30 M or ...
user avatar
  • 329
0 votes
1 answer
19 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, ...
user avatar
1 vote
1 answer
59 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 ...
user avatar
0 votes
0 answers
34 views

MongoDB vs PostGIS for geospatial data

My main concern is that I was I/O and bounding circle queries to be lightning fast. Does MongoDB spatial offer any advantages over POSTgis?
user avatar
0 votes
1 answer
30 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 ...
user avatar
  • 103
1 vote
1 answer
27 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 ...
user avatar
  • 111
1 vote
0 answers
161 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 ...
user avatar
  • 111
0 votes
0 answers
21 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 ...
user avatar
  • 281
0 votes
0 answers
40 views

Mongo db oplog size is much bigger than maxSize and filling up disk

Running Mongo 4.4.8 on Ubuntu Focal Docker with the following start up command: mongod --keyFile /replica.key --replSet rs0 --oplogSize 991 --oplogMinRetentionHours 0.25 --wiredTigerCacheSizeGB 5 --...
user avatar
  • 117
1 vote
3 answers
75 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 ...
user avatar
0 votes
1 answer
102 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="./...
user avatar
  • 101
0 votes
0 answers
13 views

MongoDB datasize in replicaset dropped suddenly

We are using MongoDB 4.2 which has lot of collections and indexes. Yesterday we faced issue in which our mongodb started degraded performance where query which were taking few ms started taking ...
user avatar
  • 101
1 vote
0 answers
17 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&...
user avatar
0 votes
3 answers
79 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 ...
user avatar
1 vote
0 answers
22 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 ...
user avatar
0 votes
1 answer
154 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 ...
user avatar
0 votes
0 answers
43 views

MongoDB Stock Data Schema design advice

I am thinking of two structures, I don't know which is better or is there are better structure? Im seeking your advise Normal structure with code as id and time as string { "_id": &...
user avatar
  • 11
-1 votes
1 answer
29 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 ...
user avatar
0 votes
0 answers
14 views

MongoDB : How to set persisent mongos and shard configuration

I have a test environment running on Windows 10 as follows : A replica set "rs0" with 3 nodes : MONGO2, MONGO3, MONGOARB1 each running on port 27017. A config server in a replicaSet "...
user avatar
  • 283
-1 votes
1 answer
106 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'...
user avatar
1 vote
1 answer
151 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 ...
user avatar
0 votes
0 answers
25 views

Mongodb search and sort

My scenario is to search and then sort according to date for this I have made my schema like this { section:String, name:String,(always lowercase) updated_at:Date.now ...many more fields } ...
user avatar
0 votes
1 answer
45 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", ...
user avatar
0 votes
0 answers
20 views

How to enable Mongodb data encryption at rest with kubernetes operator

There is documentation for how to secure deployment using TLS with Kubernetes operator in MongoDB. But no such docs there for data encryption at rest. is it enabled by default or how to enable via ...
user avatar
1 vote
1 answer
27 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 ...
user avatar
  • 111
0 votes
0 answers
306 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 ...
user avatar
  • 283
0 votes
1 answer
54 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:...
user avatar
0 votes
1 answer
41 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 ...
user avatar
1 vote
4 answers
996 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 ...
user avatar
  • 283
0 votes
1 answer
85 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 ...
user avatar

1
2 3 4 5
47