Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mongodb]

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

1
vote
0answers
32 views

Interesting Database Designs for Product Catalogue including Recursive

I am doing some work for a client and they are creating a database of products of which I need to consume product data when it's created and updated to store in a third party service and then present ...
0
votes
1answer
121 views

mongodb - what roles the user to grant access to all databases

I have created mongouser as testuser with below roles. I want to give access for new databases for this user. what roles the user to grant access to all databases. db.createUser({ user: "testuser" , ...
0
votes
2answers
42 views

How verify if replicaset is working?

I am newbie with MongoDB and even more in administration of databases. But my boss passed me an issue to solve. SCENARIO I have two servers using MongoDB and ReplicaSet, when I run the command db....
0
votes
0answers
23 views

Mongodb default setup on Azure - default connect string from local shell

I have a new Azure VM (Ubuntu 18.04.1 LTS) which has docker. dragam@USDockerVM:~$ IRE> docker --version Docker version 18.09.0, build 4d60db4 Issued the command docker pull mongo this ran ...
0
votes
1answer
45 views

mongodb replica set No Election of Primary with 6 of 7 Nodes UP

I have 8 instances running on Scaleway , 5 for Data and 3 Arbiter. And the versions of mongo on them are such : mongodb2 (mongodb 3.4.9) mongodb4 (mongodb 3.4.15) mongodb5 (mongodb 3.4.15) ...
0
votes
1answer
31 views

Backup of MongoDB collection data and rename the collections [duplicate]

I want to take a collections data backup on a different host, with renaming the Collections. I am very new to MongoDB. Please help me with this task.
1
vote
1answer
28 views

mongorestore to --oplogReplay or not to --oplogReplay?

The MongoDB documentation on --oplogReplay is a bit vague. It just keeps saying a "point in time" snapshot. How is this different from dropping the sink database and restoring from the source? What ...
0
votes
1answer
18 views

E: Version '2.0.25' for 'mongodb-10gen' was not found while installing this specific version

I'm trying to install version 2.0.25 for some testing work. I followed this documentation. Here are the steps: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo 'deb ...
0
votes
0answers
90 views

Forgot mongodb admin password

Forgot Mongo DB admin password, how can we get/reset it? Can we create new user with admin rights? Can we set admin by disabling any settings in config file?
1
vote
1answer
90 views

MongoDB merge two collections and drop documents with same value in field

In my database I have two collections, but some documents were added (possibly) at different times to both collections. I could use mongodump and then mongorestore for merging. But then I have the ...
1
vote
1answer
46 views

Mongodb as a data ware house?

Will mongodb a good choice as a data warehouse considering following situation? We are building analytics, report generation platform for our client and a typical table growth in terms of rows will ...
0
votes
0answers
19 views

Should images be embedded in a MongoDB document when there is a one to many relationship?

Please see the DDL below from my CQRS write database: CREATE TABLE Offer (ID uniqueidentifier NOT NULL, Description varchar(50), Image varbinary(max), primary key (ID)) CREATE TABLE Person (ID ...
1
vote
1answer
116 views

Mongo queries are slow and yielding/waiting for locks thousand times

We are using mongo setup with replica sets on AWS. Setup Details: 1 Primary node: r3.8xlarge 4 secondary nodes: r5.xlarge Mongo version: 3.0.8 (WiredTiger) Database size: 358GB We have configured ...
3
votes
1answer
53 views

Mongo WriteConflictException in log file

I am experiencing ALOT of this WriteConflictException in my mongo log file, this does not seem to affect the application, because I am not seeing any special errors and everything seems to work fine. ...
1
vote
1answer
52 views

Best practices for Feed restructuring in a social app database

I have a social app, where users can post to the school they chose on registration. Each post can have a hashtag and a school (all pointers, (hashtag is optional, school is not)). Users see posts ...
2
votes
0answers
34 views

MongoDB - Best practices for Feed restructuring in a social app database [duplicate]

I have a social app, where users can post to the school they chose on registration. Each post can have a hashtag and a school (all pointers, (hashtag is optional, school is not)). Users see posts ...
1
vote
1answer
85 views

Disk block size for mongodb deployment

Why does Mongodb production notes have no recommendations about the disk block size? AFAIU, disk block size would have a considerable impact on a throughput intensive application. Does disk block size ...
0
votes
1answer
897 views

MongoDB - Mongoose query findOneAndUpdate() doesn't update/duplicates the DB

I am trying to save and update (upsert: true - creates the object if it doesn't exist) the result of the Web Api which contains multiple arrays of data to populate the stock chart. Each time I enter a ...
0
votes
1answer
38 views

Equivalant MongoDB query of MySQL date query with arithmetic operations

How we can perform the below given MySQL query in MongoDB preferably in MongoDB-4.0: SELECT *,ABS(TIME_TO_SEC(TIMEDIFF(now(), datefield))/3600) as hours, (field1*field2*field2+field3*(1/(ABS(...
0
votes
1answer
56 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
72 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 ...
2
votes
1answer
115 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 ...
2
votes
1answer
27 views

Getting exception on running sh.status() command on MongoDB sharded cluster

I am running sh.status() command on my mongos instance of sharded Mongo cluster and I am getting below exception. mongos> sh.status() assert: command failed: { "ok" : 0, "errmsg" : "error ...
1
vote
1answer
32 views

Service Discovery for MongoDB

What is the best way of implement a Service Discovery like ETCD for use in a mongodb cluster? I wish have, 1 master for HA and two nodes, in my master i have a static ip, but nodes maybe can changes ...
3
votes
2answers
68 views

How to promote hidden mongo node to primary?

We are trying to implement DR setup for our mongodb replica set and currently three nodes in DR are configured to run as hidden nodes. We are trying to test failover to DR which will require promoting ...
1
vote
2answers
41 views

NoSQL or MySQL for storing API usage

I need to be able to track API usage in order to generate reports or charts later. I've been struggling to decide whether to use regular MySQL or something like MongoDB or Elastic Search which I don't ...
0
votes
1answer
45 views

Capturing mongo replica set state from mongo shell

I am trying to capture mongo replica set state from mongo shell. E.g. [root@server ~]$ mongo MongoDB shell version v3.6.8 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.8 rs0:...
5
votes
1answer
126 views

MongoDB Migrating away from RocksDB to WiredTiger

We have been working for some time with RocksDB as our engine and we are now trying to migrate to WiredTiger. We have some pretty big databases around 4~12 TB of data and according to the process ...
1
vote
1answer
71 views

unable to start mongod - Fatal assertion 28579 UnsupportedFormat

I was frequently getting Segmentation fault (core dumped). Not knowing what to do, I just restarted my ubuntu. Then tried repair which failed because of Segmentation fault. Now when I am trying to ...
1
vote
1answer
21 views

MongoDB failure scenario

Design Question- During data insertion, if MongoDB failed, can I try multiple retries? I have read somewhere it will retry only one time. What will happen if retry fail? Can I keep the failed ...
1
vote
1answer
30 views

Mongodb ReplicaSet Changing Config Format

I have a 3 node mongodb replica set which uses the old syntax (non-Yaml) syntax that I am trying to change to use the new Yaml syntax old syntax auth = true bind_ip = 0.0.0.0 dbpath = /var/lib/...
0
votes
0answers
27 views

Why slaveDelay is not respected by mongoDB replica?

I've seen related article below: Mongodb replica config slaveDelay but data still sync immediately My secondary node is set to be delayed by 3600 seconds: ... "members" : [ { "_id" : 0, ...
0
votes
1answer
36 views

How is the MongoDB backup snapshot transferred from Ops Manager to file system store?

I am using Ops Manager for backup and restore. In docs, it is mentioned that the initial sync between deployment database and Ops manager happens via streaming 10 MB compressed files. https://docs....
1
vote
1answer
55 views

MongoDB deployment across cloud and On Premises

We are planning to implement MongoDB as a stretch cluster which includes Primary secondary in DC 1, Secondary secondary in DC 2, Arbiter in cloud(DC 3) where DC 1 and DC 2 are on premise servers and ...
0
votes
0answers
107 views

Best design for this project - MongoDB many-to-many self reference

I'm new to MongoDB and I wanted to create a collection of users that can subscribe to other users (basically a self join). Which of the following way is better (if any) and why? 1: Store both the ...
2
votes
0answers
92 views

Should Azure host write-caching be enabled when using MongoDB's WiredTiger storage engine

I have several virtual machines on Azure running a mongoDB replicaSet with the WiredTiger storage engine. I'm not sure about the proper host caching option to set on the disks that contain the MongoDB ...
3
votes
1answer
92 views

MongoDB Facet Error pipeline requires text score metadata, but there is no text score available

I created a mongodb faceted pipeline that the following is a subset of: db.books.aggregate( [ { $facet: { "categories": [ { $match: { $text:...
0
votes
2answers
32 views

Co working Space DB architecture [closed]

I am trying to build a platform to share the empty desks in an office with someone outside the premises to utilize the space and generate some revenue. I am thinking of three major roles: Member who ...
-1
votes
1answer
32 views

MongoDb User with readWrite can create database

I dont understand why my user can create data base. The user "toto" with role "readwrite" on DB1 can create a DataBase (db2). And with the same account "toto" I can create a user and affect this user ...
1
vote
1answer
57 views

How to test whether unique index can be created in MongoDB?

I want to add a new unique compound index to our production system. Before doing the change, I would like to check whether the field combination is unique, i.e. will the index creation succeed or fail....
1
vote
0answers
260 views

MongoDB query: date range (but dates in collection are in NumberLong format)

I need some help with my MongoDB query. I was trying to count in collection the number of entries for a specific date (i.e. May 05, 2016), but dates in the collection are in NumberLong data type. So I ...
0
votes
1answer
319 views

sudo service mongod start returns error 100

I'm encountering the following error upon executing sudo service mongod start in terminal. mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled;...
1
vote
1answer
93 views

MongoDB aggregation $unwind and 1NF

I have a basic rhetorical/theoretical question for people experienced using both MongoDB and RDBMS. Surprised SO has no Data Munging or Data Engineering forum. In making an aggregation pipeline in ...
0
votes
1answer
52 views

What is the point of a consistent and partition tolerant multi-master DB Architecture as opposed to Master-Slave

I should emphasize that my question is in regard to CP (Consistent and Partition Tolerant) systems. A lot of widely used NoSQL databases such as Mongo and Redis seem to fall in the CP category. And ...
1
vote
0answers
23 views

Java app crash after shard failover

I am using a Mongo sharded cluster with 4 shards. All shards are a 3 members replica set with a PRIMARY with priority 1, a SECONDARY with priority 0.5 and an arbiter. The Mongo config server is a 3 ...
0
votes
2answers
242 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: ...
1
vote
0answers
61 views

mongodb aggregation query performance

We have a collection PurchaseOrder, it has embedded array of documents PurchaseOrderLines and another embedded document Warehouse. The record count is about ~4m for PurchaseOrder and each purchase ...
1
vote
0answers
149 views

Which is better schema for given discussion forum, MongoDB

Lets have two variants of nosql collection for storing discussion comments. Assume discussion, where is only one thread/root comment with 100 replies. A./ collection: discussion_thread (id, ...
1
vote
0answers
49 views

timeout while dropping database - MongoDB

Getting time out issue while dropping database from mongoDB. Database size is around 200GB. {          "code" : 46,          "ok" : 0,          "errmsg" : "timed out waiting for DBNAME....
-2
votes
2answers
39 views

What DB should I use in my case? [closed]

I'm writing a software in C# that downloads some data from a website and stores it in a DB daily. The data is cases that were processed at that day. Each case has attributes like case_creation_date,...