Questions tagged [mongodb-3.6]

92 questions
13
votes
1 answer

node is not in primary or recovering state

My config file is: systemLog: destination: file logAppend: true path: c:\data\log\mongod.log storage: dbPath: c:\data\db journal: enabled: true replication: replSetName: "rs0" net: bindIp: 127.0.0.1 port:…
invzbl3
  • 277
  • 1
  • 4
  • 10
5
votes
1 answer

MongoDB GridFS triples the file sizes

I really like using mongodb to store my data and recently I tried out GridFS and it really fits my use case. My problem with it is the space requirement, which seems quite odd. I have ~107GB of images in Amazon S3, which is around 1 million files…
szabkel
  • 264
  • 2
  • 11
5
votes
1 answer

How do we reference to a collection in MongoDB?

This is my first my first post in this forum. I am from RDBMS background and wanted to learn MongoDB which will help me in migrating our applications to MongoDB. I am creating two collections (customer & address). Customer collection Has generic…
Gokulnath Kumar
  • 51
  • 1
  • 1
  • 3
4
votes
1 answer

Why $group is very slow in aggregation and how can faster it in MongoDB

My query is taking ~3 seconds to execute with the $group stage, How can I faster this? My query is: db.getCollection('employee_data').aggregate([ { $match: //Filter }, { $group: { _id: { employee_id:"$employee_id", …
Abhilash Lohar
  • 41
  • 1
  • 1
  • 2
4
votes
1 answer

MongoDB crashes with out-of-memory or is being killed by oom-killer

A two shards MongoDB database regularly crashes with out-of-memory error or is being killed by the oom-killer. The system runs on GCE Debian 9.4 with MongoDB v3.6.5, WiredTiger storage engine and without swap (as is the practice on GCE). The servers…
ssasa
  • 261
  • 4
  • 11
4
votes
1 answer

Why does mongodb fail my json schema validation?

I am using mongodb 3.6 and have below validator for the students collection: rs1:PRIMARY> db.getCollectionInfos({name: 'students'}) [ { "name" : "students", "type" : "collection", "options" : { "validator" :…
Joey Yi Zhao
  • 577
  • 3
  • 9
  • 23
3
votes
0 answers

MongoDump Failed: error writing data for collection `collection` to disk: error reading collection: EOF

[BACKUP COMMAND] mongodump --host 127.0.0.1 -d database --port 27017 --username username --password password --out /output/path/mongodump_DATE_12_00_AM [ISSUE] Failed: error writing data for collection collection1 to disk: error reading collection:…
Kavin
  • 31
  • 1
  • 2
3
votes
2 answers

MongoDB does not allow to create unique partial index in field that contains null

I'm using MongoDB 3.6.9 (with Ubuntu) to save a set of documents that contain one field named rss_id and for some documents, this field has the value null. I want to create a unique index in that field and tried this solution. From the documentation…
Miguel
  • 139
  • 1
  • 4
3
votes
1 answer

Not authorized on admin to execute command mongoDB: Atlas M0 Free Tier cluster

My MongoDB shell has version v3.6.5 (the same with older versions) & MongoDB server has version: 3.6.8 I have MongoDB M0 Free Tier cluster and I want to use from shell different commands. So, I created admin user with password: Set up IP…
invzbl3
  • 277
  • 1
  • 4
  • 10
3
votes
1 answer

Mongodb create user with only read and write access

Hi I created a new using using following command in mongodb, db.createUser({ user: 'csquad', pwd: 'somepass123', roles: [ { role: "readWrite", db: "cloud"}]}); Now this user is able to login to db Cloud and do any activities. Including he is able…
2
votes
1 answer

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 single member replica set. The problem is that my…
Tayum
  • 23
  • 1
  • 4
2
votes
0 answers

getIndexes returns empty array on MongoDB collection

I'm trying creating indexes on a MongoDB collection and while they are correctly created and they work (I can see the index in the executionStats), the output of the getIndexes() function is an empty array: > db.shopOrder.createIndex({'userId':…
Matteo Riva
  • 121
  • 4
2
votes
1 answer

Mongodump Backup Resume

My database size is approx 1.5 TB and I have approx 2TB free on backup mount point. But after 10 hours my backup fail due to lack of storage and its just 60% complete. Is their any why through which i can resume my backup from the failure…
Irfi
  • 53
  • 7
2
votes
2 answers

Should I put users in admin DB or in the DB that they should have access to

What would the pros / cons be of putting users that should have access to one database in the admin database instead of the database that they should have access to? Background: I'm a C# developer. This is the first live project using mongodb I'm…
mortb
  • 71
  • 5
2
votes
1 answer

High CPU Utilization for Mongodb ReplicaSet Secondary Nodes

I am using MongoDB server version: 3.6.4 (WiredTiger storage engine) with 3 node replica set on AWS r4 large machines. Sharing the CPU Utilization graph of all the nodes Primary (with .33%) Secondary 1 (with ~99%) Secondary 2 (with ~99%) I tried…
rahulb
  • 121
  • 1
  • 2
1
2 3 4 5 6 7