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.

0
votes
1answer
96 views

Create a single-server replica set only for watching on change streams

I have a MongoDB database which is of relatively low importance. I shovel data from home automation stuff into it (mostly sensor data, sunlight, switch states and so on) and don't need any replication....
0
votes
1answer
64 views

mongodb - monthly archival of data

Coming from a RDBMS background, this is what I have done in the past. Create a table with partitions based on a date field. There are typically three tables (partitions) - current (M0), previous ...
1
vote
2answers
342 views

Update single field in a document (document.update($set)?)

Can't seem to figure out how to update a single field. Whatever I try, to update one field (picture: "url") the rest of the fields are being removed and set to null. I use the following command now: ...
0
votes
1answer
233 views

Query sharded collection returns all the results from the primary shard AND from the other shards

I tried to set up a shard to test this functionality and maybe migrate some of our data into it. I followed the documentation guide https://docs.mongodb.com/v3.4/tutorial/convert-replica-set-to-...
1
vote
1answer
47 views

Amount of Data transferred out in mongorestore

I'm using MongoDB version 4 Consider I have a database with dataSize 15GB, storageSize 10GB. After I mongodump --gzip it, the file created is of 5GB. Now, If I'm restoring it to a remote machine (M2)...
1
vote
0answers
11 views

MongoDB replication on a single server [duplicate]

I am working on a project with a Mongo Database for storage. The current setup is one Virtual Machine with a single Mongo Database. We notice a performance degradation when executing some heavy ...
1
vote
1answer
27 views

Get latest data for specific identifier

I have an application that (mostly) uses only the very latest data available for a certain identifier (may consist of multiple columns/keys). However, these data may be bad or implausible. In these ...
-1
votes
1answer
24 views

Mongodb restriction on update to only allow “$push” operator

Mongodb V 4.0 I want to restrict a user's role by only allowing new inserts to the collection. Either as a new document, or as an append to the document. I don't want the user to be able to update(...
2
votes
1answer
593 views

How to restore from .wt files?

Environment Windows Professional 10 MongoDB 3.6.4 2008R2Plus SSL (64 bit) (before computer crash) MongoDB 4.0.2 2008R2Plus SSL (64 bit) (after computer crash) I have been developing locally, and ...
0
votes
1answer
50 views

dokku-mongo Export Database Error

dokku-mongo export Database command is showing error "This does not look like a tar archive" $ ssh svuser@dbexample.com $ dokku mongo:export database > backup.tar $ tar -xfv backup.tar tar: This ...
0
votes
2answers
47 views

Connecting to monogdb with string

I'm trying to connect to MongoDB using a MONGO_URL:. This particular database has a username and password. I've created a user to allow readWrite commands and that's the one I'm using. If I log into ...
0
votes
1answer
73 views

unable to add a range to a tag using sh.addTagRange command

Have setup a 4 node test shard cluster: 1- mongos 1- config server 2- shard nodes hosting 1 shard each for a collection. Cluster is working perfectly, but when trying to run the following command: ...
1
vote
1answer
487 views

How to restore Mongo DB tar.gz archive

Using the Mongo DB Atlas cloud service (MongoDB Version: 3.4.16), the below backup archive of a MongDB was generated: Cluster0-shard-0-1531635127-5b4b0df33b34b92b0f50a045.tar.gz In this file I can ...
0
votes
1answer
429 views

mongodb setFeatureCompatibilityVersion command not found

I'm trying to upgrade my mongodb from 3.2 to 3.4 and I try to set the compatibility version by: db.adminCommand( { setFeatureCompatibilityVersion: "3.2" } ) But it says { "ok" : 0, ...
0
votes
1answer
49 views

MongoDB secondaries become unresponsive during replication

We got 3 Servers running. One Primary, two as secondaries. Primary has 4 vcpus, 16 GB memory, both secondaries have 8 vcpus, 64 GB memory. Every night, we run a full sync with several large ...
0
votes
1answer
2k views

Can't start mongodb server using 'sudo service mongod start'

I'm trying to set up a dummy mongodb server on my local device so I can play around with it and make mistakes so that I can feel confident editing the actual server. I use the following code to start ...
0
votes
1answer
118 views

Mongo doesn't restore user password

I have following scenario: Dump Mongo database (cmd mongodump) Change password from one of admin users Restore Mongo database (cmd mongorestore) EDIT: I use following command for db dump: ...
1
vote
0answers
95 views

Mongo 4.0 replicaSet recovery SegFault

After doing rs.initialize() on two repica instances (aws ubuntu 16.04) and mongo 4.0.1 I get the following SegFault which I assume happens during replicaset recovery. Is it a mongo 4.0 known issue? ...
1
vote
0answers
137 views

MongoDB Warning impossible to clear

I'm using Ubuntu 16.04 and MongoDB 4.0.1. When I use mongo shell I got this : I STORAGE [initandlisten] I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with ...
12
votes
2answers
7k views

Mongodump: Unrecognized field 'snapshot'

I am using mongodump from mongo tools to download a backup of my server. However as I run the command, the command returns "Unrecognized field 'snapshot'". The full error is: Failed: error reading ...
0
votes
1answer
412 views

Connecting to a self signed mongodb server though mongo shell doesn't require `pem` file

I am using nodejs mongodb driver to connect to a self signed mongodb instance. The MongoDB and Mongo Shell version is 4.0.0. Below is the command to launch a self signed mongodb instance: mongod --...
1
vote
0answers
85 views

Auth failing when using Devart ODBC connector to mLab

I'm trying to connect PowerBI to a mLab-hosted Mongodb instance. I first tried installing the MongoDB BI-connector, but after installing it didn't show up on the drivers list in Windows ODBC manager (...
1
vote
0answers
22 views

How to do a find query on the result of another find query?

I'm working with MongoDB because the company where I work is doing a migration from pSQL. We have reports with filters: first the report lets you select a range of dates by year and month, then you ...
0
votes
1answer
157 views

Connection error while installing mongodb on fedora 28

I have been trying to install Mongodb but it keeps failing midway. When the download is complete, installation fails with a connection error: MongoDB shell version v3.6.3 connecting to: mongodb://127....
1
vote
1answer
718 views

Get the size of list of documents in mongo db

I want to get the size of the list of documents in mongodb. db.getCollection('eventDetails').find({"dateTime" : { $gte : new ISODate("2018-05-01T12:00:00Z") },"dateTime" : { $lte : new ISODate("2018-...
1
vote
1answer
323 views

How to permanently enable Read Access for MongoDB Secondary Node?

Upon trying to connect mongodb secondary node from application : 08:11:2018 16:01:00.552 - error: A hook (orm) failed to load! 08:11:2018 16:01:00.558 - error: Error: Failed to connect to MongoDB. ...
1
vote
2answers
57 views

Mongodb Products schema with proper indexes

I'm totally new to mongodb with a MYSQL background. I'm working on an e-commerce website with some millions of products So we decided to migrate from MYSQL to mongodb. So far this is the products ...
1
vote
1answer
243 views

How many files are created by default using WiredTiger storage engine?

So, I got a question on a test (without answer unfortunately) that left me with a big doubt whether it's true or false. The question is this: "By default, WiredTiger storage engine creates one file ...
1
vote
1answer
103 views

Is it possible to restore mongodb after db.dropDatabase() by replacing the contents of folder /data/db with older backup?

In order to reset replication, I did drop the local mongo database using the following commands: use local; db.dropDatabase(); The mongo data directory(dbPath) is /data/db/ I took a backup of this ...
1
vote
1answer
417 views

How to correct Failed global > initialization: FileNotOpen

I am trying to run eos and using the std docs - https://developers.eos.io/eosio-nodeos/docs/build-validation I am trying - ~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf and I get the ...
0
votes
0answers
25 views

How to get distinct documents of user messages to different users?

In MongoDB we have distinct method that returns distinct values of a record from a specific collection: db.inbox.find({"inbox_type": "direct"}).distinct("sender") The above command returns distinct ...
0
votes
0answers
127 views

Force remove a dead shard from mongodb

I have a cluster with 3 shards, and one of them died. There is no backup of the shard and I can live without the data. I'm trying to remove the shard from the cluster and restart with the 2 remaining ...
0
votes
1answer
83 views

what if mongos server goes down in shard cluster setup

I have followed the tuturial Deploy a Sharded Cluster I have setup config server replica set with 3 members (cfg1, cfg2, cfg3) [replica set name = configserverreplica] mongodb server replica set ...
0
votes
0answers
14 views

MongoDB auto fail-over not working

I have three mongoD instances running in a replica set in windows. MD1 -> Primary, MD2-> Secondry, MD3-> Secondry settings.electionTimeoutMillis = 10 seconds. If I bring my primary MongoD instance ...
0
votes
1answer
310 views

How to query the mongoDB admin database?

I'm trying to execute the below commands taken from the mongoDB docs use admin db.system.version.find( { _id: "authSchema" }) But running those in Robo 3t gives the following output switched to db ...
-1
votes
1answer
3k views

Easiest Way to Migrate data from MySQL to MongoDB [closed]

My latest IT project has me working with MongoDB for the first time. While I have a bit (very little) experience with NoSQL, I have always mostly worked with MySQL using Workbench. I need to migrate ...
0
votes
2answers
102 views

sh.status() error processing query: ns=config.mongosTree

if I run sh.status in mongos I get the error: assert: command failed: { "ok" : 0, "errmsg" : "error processing query: ns=config.mongosTree: ping $gt new Date(1532712420740)\nSort: {}\...
1
vote
1answer
190 views

MongoDB sharding by monotonic id with zones for archiving

Situation: I have an ever-growing collection of documents which do have monotonically increasing unique id. All queries are direct lookup for documents with specified _id (no range queries nor ...
0
votes
1answer
17 views

Mongodb cluster issue

I would like to put in place a cluster with 2 instances of Graylog. Ideally, one of them will receive logs from servers in the cloud and the other one on premise will receive logs from servers that ...
1
vote
0answers
122 views

It is possible to take incremental backup in mongoDB Shard cluster? without opsmanager

Shard MongoDB Cluster: 3-router 3-config 2-shard (3-replica's per shard) We are tring to take incremental backup for every one hour. We gone through few google links, but no luck. As per our above ...
0
votes
0answers
33 views

Issue in accessing the mongodb data in Tableau

I am using the mongosqld to view the mongodb data in Tableau mongodb Bi COnnector 2.5 is used Mongo Document Schema for Events Collection: "_id" : ObjectId("57f824abe3301b1984sdsds"), "information" ...
0
votes
0answers
35 views

Restore data with Ops Manager

I'm currently using MongoDB, version and Ops manager is latest version with RHEL 7 OS. As per my understanding, Ops manager takes base snapshot every 24 hours or based on our schedule which can be 6, ...
1
vote
1answer
56 views

MongoDB Shard distribution issue

I am facing an issue in the shard distribution. MongoDB Version: 3.0.15 I have a collection that is sharded. I have two shards. Output of db.getCollection('event').stats() { "sharded" : true, "...
1
vote
0answers
26 views

ok design for mongodb - daily data?

So I don't have experience with Mongodb besides a few tutorials. Currently a website is set up using Mongodb for user access and for some other data. Because of this, I'd like to stick with Mongodb ...
2
votes
1answer
30 views

MongoDB Embeded Index

we have a collection in below format: { "_id" : { "a" : 8, "b" : ObjectId("5b23aa9e24826b82a2553ce7") }, "field1" : "value1", "field2" : "value2", "field3" : "...
1
vote
1answer
297 views

MongoDB Using String-Type Shard Key for Zone Ranges

Mongo lets any field type be used to set ranges for Shard Zones, but doesn't specify how analyses are conducted. My goal is to point queries and writes at the exact right server, WITHOUT using a ...
1
vote
0answers
121 views

MongoDB write locks on insert

Why would an insert into a MongoDB 3.4 collection require global write locks? I'm creating a copy of a large collection in a new replica set (via mongodump/restore) and I'm finding that some inserts ...
1
vote
0answers
44 views

MongoDB: db.collection.watch on sharded clusters

I'm interested in db.collection.watch feature on MongoDB sharded clusters. Did you have any problems with it in the production environment? To guarantee total ordering of changes, for each change ...
0
votes
1answer
154 views

Transfer Data between MySQL and MongoDB Databases [closed]

My latest IT project has me working with MongoDB for the first time. While I have a bit (very little) experience with NoSQL, I have always mostly worked with MySQL using Workbench. I need to migrate ...
0
votes
1answer
56 views

Ops Manager clarification

I am quite new to MongoDB ops manager backup process I have understood basic ops Manager setup from the document https://docs.opsmanager.mongodb.com/v4.0/tutorial/install-basic-deployment/ My doubt ...