Questions tagged [mongodb]

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

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

Schema design: Anonymous user's data across registration

This is a schema design question; implementation is going to be Mongo, but answers are platform agnostic. Given an app, which has users, sessions, and items. All visitors will have a session ...
0
votes
0answers
12 views

MongoDB restoring to existing replica set (avoid creating a new one)

I have a MongoDB cluster runnning on 3 AWS EC2 instances, 1 for primary and 2 secondary nodes. I'm trying to perform a backup and restore without having to recreate the replica set. mongodump seems a ...
0
votes
0answers
17 views

MongoDB replica set in swarm gets very slow when one node is down

I created a 3 nodes replicaset with mongodb that I host in a swarm environment. To do so, I created 3 services mongo1, mongo2, mongo3 with the same configuration. When I challenged the resiliency of ...
0
votes
1answer
11 views

Mongodb Index not used in case of $or query

I have added created a collection first and created index db.first.createIndex({a:1, b:1, c:1, d:1, e:1, f:1}); and inserted data db.first.insert({a:1, b:2, c:3, d:4, e:5, f:6}); db.first.insert({a:...
1
vote
0answers
9 views

does mongodb have any compiled list of non compatible functions on sharded cluster?

does mongodb have any compiled list of non compatible functions on sharded cluster? I was looking for a compile list of non compatible functions on sharded clusters, so we can anticipate the changes ...
0
votes
0answers
9 views

MongoDB insert data if not exists and update only the array if exists on large amount of documents

So I have about 1M records to first insert and then subsequently update an array in them whenever I run the script. A typical record { "_id" : Object(), "id" : "my_unique_id", ...
0
votes
1answer
9 views

How to store null in a double field in mongodb

My mongodb schema has a field of "double" data type. Sometimes, when there is no value for this field, mongo is storing it as 0.0 but I need it to store as null My Schema: db.createCollection("...
0
votes
0answers
8 views

Collection data not seen in mongos sharding

I have configured sharding with 3 replica sets as shards and one config server in replication. One Mongos router is running. Have restored a collection into new database in one of the shards using ...
0
votes
0answers
10 views

Mongodb Ops Manager url changed [on hold]

Recently we successfully updated the hostnames of the mongodb servers from short hostname to FQDN. Now we are not getting automation logs on the server, however we are able to see the logs on the ops ...
0
votes
0answers
14 views

indexSize mismatch between primary and secondary members on wired tiger engine

we are using mongoDB 4.0 on wired tiger engine. For the last couple of days, we are observing that indexSize of primary server(marked in blue in attached file) went up drastically compared to its ...
-1
votes
0answers
16 views

to write and read in real time daily 15GB data - help select DB [on hold]

Currently, data is managed in a file(csv). The amount of data collected during the day is about 15GB per day. (10-15 GB) Currently, it is saved only as a file and later processed and analyzed. but ...
0
votes
1answer
31 views

MongoDB 4.2 using change streams with read concern majority disabled in a PSA deployment

I currently run a PSA (Primary, Secondary, Arbiter) deployment and thous only have two databearing nodes. In case of a databearing node going down, read concern majority prevented the change stream to ...
0
votes
0answers
17 views

swap collections in mongoDB

I receive current day transactional data which I dump into a collection called 'collA'. The data will be reportable for max of 4 days, after this the data becomes useless to me. Are the below two ...
0
votes
1answer
19 views

Benchmarking MongoDB full text search vs MSSQL full text search

I'm working on a project for comparing mongodb and mssql databases performance on full text search. I started with using YCSB benchmark but now that I have a deeper understanding about this benchmark, ...
0
votes
2answers
31 views

usage percentage of Mongodb internal cache

I've ran two performance test on a MongoDB server with identical environment/settings AFAIK. I found that the throughput was 10% apart. When I inspected the mongostat logs, I found that Mongodb in ...
0
votes
0answers
23 views

What does config shard mean here?

I created a MongoDB sharded cluster with replica set rsa, rsb and rsc. Configuration server replica set is configRS. Initially shard status listed only these shards as primary shard for the sharded ...
0
votes
1answer
26 views

MongoDB Replica Set Sync data by Copying Data Files from Another Member

I used MongoDB 3.6 and was following MongoDB documentation: https://docs.mongodb.com/manual/tutorial/resync-replica-set-member to do a full copy of data from Primary node to another mongod instance....
0
votes
1answer
27 views

Connectivity issues in replication process

I've been trying to add a new node to a replica set without success due to these errors: 2019-08-12T06:48:15.031+0200 I ASIO [NetworkInterfaceASIO-RS-0] Ending connection to host mongo03:...
0
votes
1answer
22 views

Add a new node to Mongo Replicaset using Rsync

I have a 3 shard mongo cluster. Each shard has a 3 node replica set. On each shard, the data size is 3 TB. I want to add 1 more node to each replica set. But its taking lot of time. The initial sync ...
0
votes
2answers
20 views

MongoDB 2.0.9 IndexStats

I am trying to get the index usage statistics in a mongoDB 2.0.9. I found a similar question in https://stackoverflow.com/questions/44813787/how-to-check-index-usage-in-mongodb but this only applies ...
1
vote
1answer
22 views

Sharded Mongodb stalls randomly

I have setup Sharded MongoDB cluster using hashed sharding in kuberenetes.I first created the config server Replicaset and then created 2 shard replicasets. Finally created mongos to connect to the ...
0
votes
1answer
16 views

MongoDB Server Log to file and rsyslog

I have to forward my logs to rsyslog via UDP, but due to the volatile nature of UDP and rsyslog I would like to also log to a file. However, AFAICT MongoDB only allows one target for its logs: ...
2
votes
1answer
14 views

mongorestore from multiple dumps

I have a mongo-database where existing entries never change but new entries are added every day. I have ~1000 dumps, each is the new data that was added on the corresponding day. I.e. I have the ...
0
votes
1answer
31 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
0answers
24 views

mongodb keyfile permission denied

I configured in /etc/mongod.conf to enforce keyfile access control, in security option enabled, keyFile is /root/dbtest.key (the absolute path of keyfile). I already gave the ownership to mongodb user ...
0
votes
0answers
14 views

Backup and restore a subset of a mongo collection that includes all the GridFS references and related document?

I have a big collection in MongoDB GridFS database. How can I backup a subset of the collection by date filter and all the GridFS related collection in the chunks, files and gridfs bucket will be ...
0
votes
0answers
11 views

run cleanupOrphaned in a loop do not remove all orphaned documents from the shard

MongoDB v3.4.1, run cleanupOrphaned in a loop do not remove all orphaned documents from the shard,is there any prob? 1.use mongoshake migrate mongo sharding ,there is duplicate error ,key is _id ...
0
votes
0answers
15 views

Remove linked GitHub Repository from Mongo Stitch

MongoDb stitch is providing the continuous integration choice to maintain our stitch entities. For the testing, I have linked the sample repository to the stitch app's Deploy option. Now, I just want ...
0
votes
1answer
28 views

mongoDB won't stop with shutdown or kill

Not sure If I can make the same question already made here but here it goes. I have a mongodb fork and running with high CPU usage. I'm trying to shut it down but nothing seems to work. 2729 mwon ...
0
votes
1answer
19 views

Need Another MongoDB Binary?

I have a three-node MongoDB test replica running normally. I want to add an Ops Manager to it also residing on these three nodes. Do I need to install another set of MongoDB binary for the Ops Manager'...
0
votes
2answers
39 views

join two collections with group by and sum in Mongodb

i have this two collection and i want to join, after this I want to sum the value of TotalPrice each orderdate : some line of my two collections the first collection date : {"Id_Date":1,"...
0
votes
1answer
26 views

How to add a fixed string to a mongoDB result like we do we in SQL Server?

We have this syntax with SQL server: select name as 'database', 'I_Love_SQL' as 'feelings' from sys.databases which will return results like this: database | feelings database1 | ...
0
votes
1answer
35 views

High CPU usage on fresh new install of MongoDB

I read a lot of post about high CPU usage of Mongo but almost all relates to queries. I just did a fresh install of MongoDB 4. I have no other databases than the default one. As soon as I start the ...
0
votes
0answers
8 views

Mongodb - AssertionException

Been getting the below exception in huge volume in the logs of mongos. "connection accepted from AssertionException handling request, closing client connection: 17189 The server is configured to only ...
0
votes
1answer
19 views

Converting MongoDB instance from Standalone to Replica Set and Backing Up

I want to convert my MongoDB 3.6 standalone server to a replica set so I can watch a collection using change streams, which requires an oplog. I only want to use change streams so will keep this as a ...
0
votes
0answers
26 views

Performance Problems with MongoDB Atlas M0 with Larger Documents

Problem Description Our team is developing a small web application for an academic research project, which is currently hosted on Heroku and connects to a MongoDB Atlas M0 (Free Tier) database. The ...
0
votes
0answers
9 views

Find an equivalent way to make “$setIsSubset” with AWS DocumentDB

I need to find another way to make this operation : "$setIsSubset" with AWS DocumentDB (MongoDB like). I'm not an expert with the mongo request, but I need to convert this instruction for my ...
0
votes
1answer
23 views

Sharding a MongoDB instance by a spatial key and a date

This may be more an advice than anything else, but I'm designing an app that stores in a table objects that have a 2dsphere index and they also have a date (+time), both of them being part of queries ...
0
votes
1answer
47 views

mongodb - Replica set creation error: Quorum check failed because not enough voting nodes responded

I am configuring a mongodb replica set. From my current primary node, when rs.add('host1:27017'), it yields this error Quorum check failed because not enough voting nodes responded; required 2 but ...
1
vote
0answers
30 views

Does restarting Mongodb config servers restart the mongos?

Our environment is a 2 node Shard of 5 node replica set with a 3 node replica set config servers and 6 mongos. We happened to change the hostname(short to FQDN) of 1 of the config server and we ...
0
votes
0answers
15 views

How to query Groupy by and count with lookup in Mongodb?

I am trying To use group by in a collection and COUNT in another collection. I have 2 collections. One for customer and other for order_fact. Example Sample data for collection customer. {"Id_Cust":...
0
votes
0answers
18 views

How would I structure embedded fields such that 2 collections can access them?

Sorry for the vague title had trouble trying to word it. Essentially I'm making a Discord bot and I'm making a ranking system for it. I have Users and Guilds collections and I'm wondering how I'd ...
0
votes
0answers
30 views

I am trying to run mongod --repair command. But It always fails

I am trying to run mongodb --repair command after running for a considerable amount of time it shutsdown with following logs. t.oplogTruncateAfterPoint" } 2019-07-11T20:36:14.034+0000 I INDEX [...
0
votes
0answers
10 views

How to add calculated value as a field into an existed array of sub document using MongodB aggregation

I'm working on MongoDB and I have a document like below structure. I am trying to calculate total services cost and each services lane cost. Here services are sub document. My document structure: { ...
0
votes
0answers
15 views

How does the MongoDB $filter (aggregation) stage work internally?

I was asked a question by a colleague today whether the MongoDB $filter aggregation stage is implemented efficiently. The aggregation stage in question: $project: { absences: { $filter: {...
0
votes
1answer
31 views

Mongo replication sync halfway SocketException: remote: 192.168.168.122:27017 error: 9001 socket exception [RECV_ERROR] server [192.168.168.122:27017]

I got one mongo v2.4.10 server with 1.7TB data, I am trying to migrate and upgrade the mongo to mongo v.3.0.15 server I've setup a new mongo v.3.0.15 and configured replication for v3.0.15 to be ...
0
votes
0answers
28 views

How to get custom function result in query in MongoDB

I have experience in MySQL and new to MongoDB. What I need to achieve is below. MongoDb collection is like: What I want is a query similar to MySQL as: Select title,binary,hummingDistance(this....
0
votes
1answer
23 views

MongoDb Join VS Nested Query

I'm trying to build a game server and we are using MongoDb as the database. We have a collection Games that has models like this: { "_id" : ObjectId("5d1b345b8ea742034db76431"), "Users" : [ ...
0
votes
0answers
17 views

MongoDB date range index bounds

I have a mongodb (V3.6.10) collection with the following stats&indexes: { "ns" : "RepoProd.raiding", "size" : 145312567936, "count" : 6776728, "avgObjSize" : 21442, "...
0
votes
1answer
44 views

MongoDB stuck in startup2 state

I have a Mongo replica set (MongoDB server version: 4.0.3) with primiry, secondary and arbiter. Size of database is about 7 Tb. I add a member to replica set. It stucks in sturtup2 mode for a month! ...