Questions tagged [mongodb]

MongoDB is a scalable, high-performance, open source, document-oriented NoSQL database. It supports a large number of languages and application development platforms. Questions about server administration can be asked on http://dba.stackexchange.com.

0
votes
0answers
3 views

Not finding mongod init.d file on amazon linux image

I was trying to install mongodb community version on amazon linux image. I was following this link. I used the .tgz tar file for installation. Every thing went well and I am able to start mongodb ...
0
votes
0answers
2 views

Can mongodb find's lt operator take the document field as argument

I have a document which looks something like this { "_id":ObjectId("5bcef414b4305f4054571305"), "timestamp": ISODate("2018-10-23T10:12:36.755 Z"), "config" : { "expiry_duration" :...
0
votes
0answers
6 views

Mongodb get embedded document data only that which macthed the condition

I am trying to get some data from my mongodb collection into the embedded document which match the condition. here is my Data from which I am trying to get only matched embedded document. {"_id":"...
0
votes
0answers
9 views

Nodejs output mongodb to html page

I try to combine two sample code, one is showing html file using node js, the other is accessing database using node js. When I try to combine these code, I cannot achieve my target to show the ...
0
votes
0answers
6 views

Unable to connect to MongoDB Replica Set from other server using robo3T and in C#

I have installed mongodb Replica Set, in the file mongod.conf has added BIND_IP as below net: port: 27017 bindIp: 127.0.0.1, 100.0.192.68 When I use robo3t to connect the "replica set" type the ...
0
votes
0answers
15 views

How do I retrieve particular List of element from MongoDB?

I want to retrieve particular list of element from the Mongodb Table. Lets suppose i have two variables in my Employee class-: public Class Employee { private String Id; private String Name; . . ...
0
votes
1answer
9 views

Mongo Db Query Json Inside Json Filter

There is an mongo table entity. @Document(collection ="A") public class A { private int id; private List<Student> allstud; //setter and getter } ...
0
votes
0answers
3 views

Pymongo bulk_write with UpdateOne throwing Scanned Objects / Returned has gone above 5000 alert

I'm having aroung 190 millions records in my collection, it has compound index {"company":1, "date":-1, "datatype":1} and it doesn't have any duplicates documents. Every month I'm upserting around 20 ...
-3
votes
0answers
15 views

How to load thousands of user data from mongodb collection in datatable shortly in node application

I am trying to load Thousand of user data(above 20,000 users from mongodb collection) in datatable quickly in node application but it is taking too much time and some times stuck the operations in app ...
0
votes
1answer
14 views

HOW TO USE CASE STATEMENT IN MONGODB WHERE CONDITION [duplicate]

I am new to Mongo Db and would appreciate some help with this query. DATA: { "_id" : ObjectId("5ba2442e9b75ee04d429ed34"), "RESOURCE_ID" : "100-101", "...
0
votes
1answer
21 views

How to create “array of arrays of objects” schema in Mongoose.js

I need to create schema for following data structure: { ... matrix: [ [{type: "A", count: 6}, {type: "B", count: 4}], [{type: "B", count: 1}, {type: "A", count: 2}, {type: "A", count: 1}],...
0
votes
1answer
10 views

email verification in mern stack

please tell me how to verify the email when signing up to a new account in MERN Stack??I want to send an email with a link to redirect to the page to the user's email.. this is my node.js code for ...
0
votes
0answers
4 views

Is Mongo's “finalize” function similar to CouchDB's “rereduce” reduce-function contract in terms of MapReduce implementation?

I have some experience with MapReduce in CouchDB, where the contract is for a reduce function is: function(keys, values, rereduce) {...} I understand CouchDB's MapReduce contract to operate directly ...
0
votes
0answers
29 views

update particular single subdocument in nested array in nodejs mongodb

I am new to nodejs and mongo db. I have nested subdocument type schema in mongo. Document type is Process => Subprocess => tasks => configs. These are in the format of nested arrays and can be ...
0
votes
0answers
8 views

returning only specific fields with mongodb using BSON java?

I want to return only specific field from mongodb where I am querying through bson filter.I tried using projection but then my query does not return anything . Source: Bson filter = new Document("...
0
votes
1answer
14 views

How do you insert multiple documents and update them the duplicates using mongoose?

I am trying to insert multiple documents using insertMany but few of the documents are duplicate. For those documents, I want to update them. For example: These are the user answer documents: ...
1
vote
1answer
13 views

MongoDB:The cursor was closed before next() completed

I was using Mongodb driver(Java) to find documents by batchCursor() method. But sometime, I received error: com.mongodb.MongoException: The cursor was closed before next() completed. I retried ...
0
votes
0answers
6 views

how to clear the cache in memory in mongoDB without restart

As far as know, MongoDB will hold memory without releasing in the process until restart it manually. But restart is not a pretty choice,i want to release the cache without restart, who has the idea? ...
-1
votes
0answers
13 views

Accessing mongodb in ASP.NET MVC gives System.TimeoutException

I am trying to read a document from the mongoDB database and display in the view. I am using mongoDB driver for C# (mongocsharpdriver). I followed the tutorial in https://www.c-sharpcorner.com/article/...
0
votes
0answers
13 views

Multiple databases with Spring Boot MongoDB Repositories dynamically

I needed to modify my Spring-Boot app to manage dynamically instances of the Mongo driver dynamically. In my app Spring Boot MongoDB Repositories is already configured, now acc. to new requirement ...
0
votes
0answers
10 views

Reinstalled mongo and unable to start

I just reinstalled to an older version of Mongo, but am unable to get it to connect. I've tried a few of the solutions online, but nothing seems to be working. Here is the error: MongoDB shell ...
1
vote
0answers
18 views

How to remove attribute within a MongoDb json when using Laravel

I wanted to fix some things in my MongoDb and I needed to add attributes fast. I did this, fast, using the add method. Now, I want to fix and remove some attributes. As you can see, by using isset($...
0
votes
0answers
9 views

using mongoose.populate with mongoose Paginate plugin

My schema is like this let serviceItemSchema = new mongoose.Schema( { "name": { type: String, required: true }, "description": { type: String, required: true ...
0
votes
0answers
10 views

Spring batch MongoItemReader ignoring database index (created via Spring Data)

I'm getting the following whenever I fire off a job, database error: Runner error: Overflow sort stage buffered data usage of 33554495 bytes exceeds internal limit of 33554432 bytes I know why ...
0
votes
1answer
30 views

Mongdb insert data in a collection from another collection using Node.js Api

I'm new in MongoDB and NodeJS. I want to do an aggregate from another collection using NodeJS. The thing is I have collection name test1 There I have some field like rcptid, rcptdate, ammount etc. ...
0
votes
1answer
9 views

Mongo/Mongoose/Multer/FS to delete an image

In the code given below:- var Image = mongoose.model("Image", imageSchema); //Assuming all the configuration of packages are done app.delete("/element/:id", function(req, res) { Image....
0
votes
0answers
11 views

Aggregation is not working in spring-boot 2.0.6 with mongo 4.0

Recently, I upgraded my spring-boot project to 2.0.6 and upgraded database too to Mongodb 4.0. I had to resolve some issues. For example, Mongo now needs define a cursor in all aggregations, so I ...
0
votes
0answers
29 views

How to return one Object without duplicate array with multiple query function?

I have a lots of city collections, I want to query different collections just in one method getMovieStyle(req, ers, next) { } that can return only one object and without duplicate array data movie, ...
1
vote
1answer
17 views

Mongoose aggregation Error: Arguments must be aggregate pipeline operators

I have wrote below code for aggregating data as per my requirement. This worked when I tried in robo 3t. What is wrong in the below code. It is giving error as "Arguments must be aggregate pipeline ...
1
vote
1answer
17 views

How to delete particular no of elements from array in mongodb

I have collection as below "_id" : "PS8720_18", "AlertID" : "18", "Status" : "ACTIVE", "triggerHistory" : [ {"triggerId" : "1535081507421"}, {"triggerId" : "...
0
votes
0answers
14 views

MongoDB Error: Unable to reach primary for set [set_name] when connect to mongo replica set

I'm trying to connect to MongoDB replica set consists of 3 mongo docker-container, but Error Message: Unable to reach primary for set rs0 occurs. Git Repository: https://github.com/frontalnh/mongodb-...
0
votes
0answers
8 views

Mongoose virtual field not working as expected

I am trying to update a mongoose model so it's backwards compatible with existing applications. The change requires me to add role to members on projects. Below is the old structure const ...
0
votes
0answers
8 views

How to use aggregate functions in pymongo (like for finding average rating and counting)?

I am specifically focusing on using avg and sorting according to resulting values in pymongo. Any help is appreciated?
0
votes
1answer
7 views

how to move URL configured in NODEJS from windows to linux box

how to move URL configured in NODEJS with MongoDB from windows server to linux server. I have not tried anything as i'm new to linux world
0
votes
0answers
10 views

MongoDB: Convert Array to CSV for Complex Data

We have MongoDB documents called Notes that consist of a Layout section and a Data section. The Data section uses the Layout section to describe and label the fields. For example, here is a simplified ...
0
votes
0answers
16 views

use mongorestore to restore a dump on remote server

I want to test mongodump/mongorestore on my remote server (ubuntu), so I did the following: ssh to my ubuntu cd to folder_to_dump_to sudo mongodump --host 127.0.0.1:27000 --gzip --db myDadabase --...
0
votes
1answer
13 views

Push new object to nested mongodb document where particular condition matches within a sub document

I am new to Nodejs and Mongodb. I am building Message Chat Functionality in my project. I have done with Message Schema. This is my User Model Schema: var UserSchema = new mongoose.Schema({ ...
1
vote
2answers
20 views

MongoDB - Array of object filter with condition

I have a json file that look like this in my collection : [ { "change":"00001", "patchset":"4" }, //etc ] Two different object can have the same "change" properties. So first I ...
0
votes
0answers
18 views

MongoDB search with colon in field name

Below is a structure of Mongo entry I have that needs to come up in search { "_id" : BinData(0, "lAAXAUCdQp2sBJH7gbGaEku2Lt07G90MXQ7OsfMmRw+UGQ=="), "subdata" : { "abcd" : "qrst", "qwer" ...
0
votes
0answers
8 views

is there a populate method for the mongoDB driver, or only for mongoose

I am learning about mongoDB, and have been using mongoose. I saw that there is a populate method that easily gets me referenced docs without much done. Is there something similar in mongoDB driver? I ...
0
votes
2answers
21 views

Mongodb C# Query Sort exceeded memory limit of

I have 2 weeks learning and working with MongoDB, I'm building a simple WinForm APP with a DataGridview. Everything was working fine but I added more than 1.000.000 documents and now it show me this ...
0
votes
0answers
9 views

Mongodb compile on raspberry pi processor not supported

I'm trying to compile MongoDB on my Raspberry Pi 3 model B+ running Arch Linux ARM with the mainline kernel (aarch64). But after a long compile time (32 hours) its given me an error with which google ...
0
votes
0answers
22 views

Why is sort functionality not using the index I created (even with the use of $hint)

I have created and ascending and descending index for a db.getCollection('objectlists').createIndex( { a: 1 } ) db.getCollection('objectlists').createIndex( { a: -1 } ) When I use this index in the ...
0
votes
0answers
11 views

How can I store different MongoDB queries as string and run it by calling a method?

I am new in MongoDB. I have some queries that I want to keep it in database as string and by calling a method, run those as MongoDB queries in asp.net core 2.1 c#. i.e. I want to keep in database this ...
0
votes
0answers
6 views

Pygermanet doesn't return any results

I hope someone can help me with this matter: I'm still starting to learn programming, so I'm really sorry if my question sounds silly. I'm trying to use pygermanet, the GermaNet API for Python, but ...
0
votes
0answers
19 views

Better MongoDB structure for a social network

I am developing a social network and I want to store my data with MongoDB and I am faced with a problem how i can store. Let me explain here is a document containing a users: { "_id" : ObjectId("...
-2
votes
0answers
8 views

Conversion between SQL and NoSQL scripts

I am new to NoSQL and application development. Is it possible to convert SQL database to NoSQL - automatically? Within NoSQL, several vendors offer the document model based databases. Some encoded ...
-1
votes
1answer
20 views

How can I trace mongo commands using C# mongo driver

How can I trace mongo commands using C# mongo driver and write commands to log
0
votes
3answers
16 views

Getting error about $pushAll when going to endpoint, but not using it anywhere

I have a strange one... I've developed an api with Node/Express/Mongoose using Mongodb 3.4.9, now it's 3.4.17. I have no ideal why, but for some reason a block of code I have been using for ages is ...
0
votes
2answers
15 views

mongo db query with group by and where

I need to convert this sql query to mongo db query: select * from ( select x, count(*) as CNT_T from table group by 1 ) aa where aa.Total = aa.CNT_T; I can do the group by (as below) but i don't ...