Click here to Skip to main content
15,891,431 members
Everything / Database Development / MongoDB

MongoDB

MongoDB

Great Reads

by Marc Clifton
A deep dive into the $lookup aggregator with examples of one-to-one, one-to-many, many-to-many, and nested relational "queries"
by Vikas Sharma
In this article, we will focus on aggregation pipeline. I'll try to cover each major section of it using simple examples. We will be writing mongo shell commands to perform aggregation.
by Vyacheslav Voronenko
Three approaches to store tree like structures with NoSQL databases in MongoDB
by DiponRoy
Quick start example to run DB and clients in docker

Latest Articles

by Akram El Assas
Car Rental Platform with a mobile app
by Akram El Assas
Rental Property Management Platform with a Mobile App
by Akram El Assas
Microservices sample architecture using ASP.NET Core, Ocelot, MongoDB and JWT
by Akram El Assas
Open Source eCommerce Platform on Next.js

All Articles

Sort by Updated

MongoDB 

7 Jan 2015 by A. Fry
MonogoDB server side projection using the C# driver
19 Dec 2023 by Aayushi Vaghasiya
I'm currently working on a project that involves a booking system. However, I've encountered an issue related to oversold bookings. Specifically, when two users attempt to book the same tickets simultaneously, the system sometimes ends up selling...
6 Aug 2014 by Abhinav S
Check out updating an existing document[^].Try http://docs.mongodb.org/ecosystem/tutorial/use-csharp-driver/[^] as well.
1 Mar 2013 by Abhishek Pant
Integrate MongoDB into java web applications[^]
22 Jun 2013 by Adam Tibi
A typical implementation of a CQRS pattern ASP.NET MVC 4, Ninject and MongoDB. I will be demonstrating a sample applications that acts as a base building block for a CQRS-based architecture.
17 Oct 2018 by Aditya Rajendra Patil
Don't mess with docker Network, else the below article on Docker with Network Complexity will be helpful!
26 Feb 2015 by Afzaal Ahmad Zeeshan
A qoutation from Note.js website[^]: Quote:Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time...
27 Feb 2023 by Agnib Pyne 2022
Hi All, I am developing a whatsapp bot as per the client requirements, using python and mongodb. Currently, am using Twilio to test the app but I need to deploy the bot with my client's own number. That support is not available in Twilio, I...
20 Feb 2023 by Agnib Pyne 2022
Hi All, I have developed a web application using .Net Core API, Angular and PostgreSQL. Also, a whatsapp chatbot has been developed using Python, Twilio and MongoDB. Now, I want to deploy these for client use and planning to host these in...
19 Jan 2017 by AHMAD ANAS
In this article, you will learn how to create console application in .NET Core with NoSQL- MongoDB.
27 Oct 2017 by Ajas Aju
Recently I started using MongoDB.I have to read specific fields(columns) from mongodb using mongodb C# driver.That means i have to read specific fields no matter whatever the values.i need to just specify the fields. How can i achieve? What I have tried: I read Collection using...
14 Jul 2023 by Akash Kr. Das
I have a MERN app, used Fetch API. I want to delete specific data upon clicking. Whenever i am clicking on delete its showing 'cannot delete.' and Status is 404: Not Found Here is my front end code please help me with this What I have tried: ...
24 Jul 2023 by Akram El Assas
Open Source eCommerce Platform on Next.js
23 Mar 2024 by Akram El Assas
Microservices sample architecture using ASP.NET Core, Ocelot, MongoDB and JWT
U 29 Apr 2024 by Akram El Assas
Car Rental Platform with a mobile app
U 29 Apr 2024 by Akram El Assas
Rental Property Management Platform with a Mobile App
29 Jan 2016 by Alazar 9860585
Calculating the Probability of Related Events Based on Bayes' Theorem Using MongoDB Aggregation Framework in C#
28 Jun 2022 by ale fan
I got this problem throw new MongooseError('The `uri` parameter to `openUri()` must be a ' + I am uploading my full be please tell me what i can do What I have tried: **index.js** const Koa = require("koa"); const KoaRouter =...
24 Oct 2023 by aledeol
I'm trying to do a generic persist method using reflecion and MongoDB. The normal code is: public bool InsertParent(ParentDTO parent) { var collection = db.GetCollection(ParentCollectionName); var...
11 Sep 2017 by ali_1
Hi All, I am in a real trouble now ! I have a Json file like below : { \"_id\" : ObjectId(\"59b24213d772ea41bc44e017\"), \"values\" : [ { \"ProductName\" : \"BH0001 \"QuantityOnHand\" : 55579.0 }, { \"ProductName\" : \"BH0101 \", \"QuantityOnHand\" : 15741.0 }, { \"ProductName\" :...
13 Dec 2018 by ali_1
Hi, I want to insert a JSON file but it's showing that duplicate _id cannot be inserted in MongoDB . I have json input file in below format {"Name":"Name1","age": 21,..................} {"Name":"Name1","age": 21,..................} can any one help ? What I have tried: var client = new...
1 Feb 2020 by alym karim
I am trying to build a dynamic menu in nodejs with mongoose, but my method is not working. i get a list of menu items with an empty coreMongooseArray as its children property [{model.children = coreMongooseArray(0)}, {model.children = coreMongooseArray(0)}] , but i should be getting a list of...
9 Apr 2015 by Am Gayathri
How to fix below error?The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'Am getting above error. I really don't have any idea about this. Could anyone help me on this?My code, ...
13 Apr 2015 by Am Gayathri
Anubody has installed mongo db in win 32 bit system, please help.I dont find Mongo DB set up file for Win 32 system in mongo db official site.[Mongo Db downloads]Here i can see set up for 64 bit but my system is 32. :(.I just installed RoboMongo without installing any other mongo db...
13 Apr 2015 by Am Gayathri
I got another link to download Mongo db for win 7 32 bit.https://www.mongodb.org/downloads#previous[^]
17 May 2021 by Aman Parmar
a)I want to connect to MongoDB b)Surround Mondodb with try-catch block c)catch exceptions. I have to use git to get the latest branch. I have assumed that the below command will run before MongoDB connection: source setenv.sh source...
1 Mar 2013 by aminov
i'm charged to developp web application with J2EE using mongodb database firstly i'm trying with a simple exemple : form login but it doesn't work.i need a simple exemple using mongodb database
22 May 2021 by Ammu Varughese
I want to display the updating count of vehicles on a particular road in my google maps w.r.t to a marker I have placed.I am using the MongoDB database from which I retrieve the count value and want to display this real time count in my map. Is...
24 Dec 2022 by Amogs
He guys, please I need some help with my NextJS/NodeJS project. I'm having the error: TypeError: Cannot read property '_id' of undefined at currentInstructor (C:\Users\Sammy\Desktop\eLearn\server\controllers\instructor.js:57:30 I can't...
16 Jan 2016 by amr mustafa
Hello , I am new to meteorJS I want to change the default db of meteor js project to existing db , my existing db url is localhost:27017\DesignerNote : i am using windows Thank you.
23 Feb 2022 by amsga
Hi All, I was wondering if there is any mechanism similar to Entity Framework Migration to populate a MongoDB collection? I am trying to prepopulate a MongoDB collection with some defaults through code level rather than manually exporting and...
16 Jan 2023 by Andre Oosthuizen
You are adding a new client twice, at the start of your code and then again within another if else statement. I am not familiar with the code used ?-Java/MongoDb -? but the basics is the same How it works - 1. Search data table for client with...
14 Jul 2023 by Andre Oosthuizen
The problem lies within your 'removeElm' function when you try to laod 'userid - the path to 'demo/users is not found and thus no 'userid' is returned. Some steps to try and find the reason why the file is not found - 1) Make sure your localhost...
16 Aug 2023 by Andre Oosthuizen
a Few changes is needed to make sure your message is sent and viewed - In chat.html - 1) Add a check to see if the user enters a message before sending it. 2) 'Listening' for the 'Enter' key press in the input field to send messages -
6 Apr 2015 by Android on Intel
The objective of this article is to show a method for accessing a REST based database backend from an Android* app using MongoDB* and Spring IO*.
29 Nov 2012 by André Kraak
Your BSON document exceed the limit being supported as the error message clearly states.See MongoDB Limits and Thresholds[^] for documentation about the limit.The way to solve this is making your document smaller.
19 May 2022 by André Marcos (Advisor), GracianoSouza
React Native, Node.js and PostreSQL, a PERN stack to develop an app to support the lost pets searching process
8 Jul 2021 by aneesh aneesh s
I am doing paging of notification list using the below code, As you can see the model has so many fields which I don't want. I just want listed id, name only to show the outer details which does not need the content or anything else. How can I...
9 Apr 2015 by anil pathak
// it will work if your .net framework would be 4 or 4.5 or upper[HttpPost]public async Task Createaccount(Register reg){ if (ModelState.IsValid) { var client = new MongoClient(); var db =...
25 May 2015 by Ankur Jasoria
Can Any body tell me how to write a connection string for MongoDB if credentional are as follows:Database Name - ABC,Server Name - DEF1,DEF2UserName - ankurPassword - ankur123I have Created at My End...
10 Sep 2015 by ankur1163
I am in strange kind of problem here. I am installing mongodb, but i am unable to start it. Here are the steps, I have done1) I have downloaded mongodb (correct version) from their website 2) Created one folder for database3)used command mongod.exe --dbpath (folder path)But the...
19 Nov 2013 by anoopk01
This tip shows how to connect with MongoDB from a .NET application.
24 Nov 2021 by Arctype SQL
There are three major types of database models in use today. Learn about their differences and what applications they are good for.
18 Oct 2015 by Arjunitedred
Hello everyone,How do I send data from a PLC (Bosch Indraworks) to MongoDB and what function blocks would be required for the same? I looked up on RIL_SocketComm.library and none of them are compatible for MongoDB. It would really mean a lot if anyone could help me with this.Thanks.
13 Mar 2022 by Arslan Anjum 2021
I have searched a lot but couldn't solve this problem. This is the Schema const ToDosSchema = mongoose.Schema({ userId: { type: String, required: true }, ToDo: [{ Task: { type: String, ...
29 Oct 2015 by Ashwin. Shetty
Scaling application Horizontally using Message queue
23 Dec 2015 by Ashwin. Shetty
Writing your first app using Mean Stack (M = MongoDB, E = Express.JS, A = Angular.JS and N = Node.js)
11 Oct 2013 by ASP.NET Community
Getting started with MongoDBMongoDB is a famous representative of NoSQL databases. It is a document-oriented database, which means that data will
1 Nov 2015 by Bala Chandra C
can any one explain step by step ,how to import sample database in mongodb because i am new to mongodb environment
23 Nov 2015 by Bala Chandra C
can any one help me step by step how to develop an api using mongodb,node,express for findbyid api with sample code please share me as early as possible
20 Aug 2014 by basker A
parent comment i added{ "_id" : ObjectId("53f444346c7daef32e037894"), "depth" : "0", "path" : "null", "created" : ISODate("2014-08-20T06:46:12.966Z"), "user_id" : "1", "body" : "hai...... hello ", "thread_id" :...
22 Aug 2014 by basker A
Recursive function - to get Children(might be parents too) of parentsoutput sample |-- Child 1.1 |-- Child 1.1.1 |-- Child 1.1.2 |-- Child 1.1.2.1 |-- Child 1.1.3 |-- Child 1.1.3.1 |-- Child 1.2 Parent 2 |-- Child 2.1 |-- Child 2.1.1 |-- Child...
2 Apr 2013 by bbirajdar
Before that you need to learn javascript .. Although the answer to your questions is quite wide , I suggest you to go through this link to get the idea link here [^]
12 Apr 2016 by Behno0o0oD
Hi everyoneI want to know about mongoDB.is there any good site or ebook related to mongoDB from the beginning?TnX
8 Aug 2013 by Benedict955
I have 2 mongodb database environments in my application and am able to switch from one to the other when testing. In one of the databases am not able to insert data, when I call db.Save(...) mongodb generates an object Id, but when I go back to retrieve using the object Id the data is not...
2 Oct 2023 by Bhanu Arora 2023
I want to store a high computational parameter to prevent its recomputation. But this parameter needs to be updated frequently to maintain consistency, should I use cache or a database or is there any other better solution for this?? I am using a...
25 Mar 2014 by Bibhu Dutta
Using MongoDB with C#
11 May 2015 by bilal78699
Hello All,I have a scenario where i have to store timesheets of different projects. The object graph is like this:Timesheet->Project->UserA user can create multiple projects. And a project can have multiple timesheets. So in my scenario it is expected that timesheet data will grow...
12 Oct 2014 by binit.ku.singh
MongoDB was designed from the beginning to scale out. Its document-oriented data model allows it to automatically split up data across multiple servers.
4 Nov 2014 by binit.ku.singh
Connect MongoDB from any working directory on ubuntu
13 Apr 2015 by Black_Rose
You can try downloading from herehttps://www.mongodb.org/dl/win32/i386[^]
28 Mar 2023 by Busenur Çetin
I solved the problem writing down how to do it in case someone will face with same error. 1)Move js folder in public folder 2)Write the code belove in signup.ejs: document.getElementById("adminSignup").onsubmit = (e) => { ...
28 Mar 2023 by Busenur Çetin
I keep getting this error on console.: "Refused to execute script from 'http://localhost:3000/js/main.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled." I tried every way I could find on the...
29 May 2023 by Bárbara 2023
Hi everyone, Im tryingto to list the data coming from the mongo db in a file handlebars. But the problem is that when I load the screen, only the message "Category Listing" appears and the names of the categories do not appear as requested: ...
18 Oct 2020 by cakka
Please help. I am using mongoose, mongodb and node.js I am trying to save data array object. But, in mongodb the field always empty. My field in mongodb is "tag" It should be contain data like : [ {tag_title: "Art", _tagId:...
3 Sep 2014 by canam2
In researching technologies for development of a single-page web application (SPA) for mobile deployment, I am trying to determine a good backend web application framework to use.I like the idea of using a NoSQL DB with a clean REST/JSON API and plan to use an client-side MVC framework like...
4 Aug 2022 by canvas_newbi
I have a collection of Groups and a collection of People (each Group or People have a unique ID). Group can hold X amount of People. I'm using the microservice methodology so my collections can't be linked together. I'm need to populate the array...
12 Jan 2021 by cgprakash
Hi, I need to retrieve data from MySQL tables and to retrieve as follows: ['Years', 'January', 'February', 'March','April','May', 'June','July', 'August', 'September','October','November','December',{ role: 'annotation' }], ['2012', 10, 24, 20,...
2 Sep 2022 by CHill60
Richard's idea is a good one and simple to implement. However it does not cater for growing data. I suggest that you extract the data as individual rows (per product per price) and then pivot that datatable to produce another Here are a couple...
5 Dec 2021 by Chinedum Ike
Okay so I just finished a 10 hour nodejs and mongodb course but whenever I look at all the cool apps you can build with node I still feel like I dont know anything since all I learnt was CRUD operations. So my question is does anyone have like a...
5 Dec 2021 by Chris Copeland
In addition to Richard's comment about correctly using async/await in your JS, you're also using it in places where it isn't fully supported. For example, the JS array functions forEach() and map() don't return Promise objects. let imgArray =...
16 Jun 2015 by Chris_Riley
I recently spent some time with Rogue Wave OpenLogic product. OpenLogic is an “open source” component review tool.
15 Apr 2020 by coccide
Hi everyone. I'm trying to figure out how can I extract the latest value of say a variable in a set of documents. Let's say I have 2 documents: { "Name": "doc1", "Date": ISODate("2019-12-31T00:00:00.000Z"), "Values" : [ { ...
15 Apr 2020 by coccide
Ok I managed to get what I want using some intermediate view objects but I think there should be a more elegant way to do that: var tutti = db.createView( "tutti", "docs", [ { "$unwind" : "$Values" }, { "$project": { "Name": 1, "Date" :...
23 Jul 2013 by Code-Hunt
Just try to do a google searchGoogle[^]
13 Aug 2013 by Code-Hunt
mongo-database-with-query-in-C...
20 Nov 2018 by codeXprojectX
I am new to mongo and need help in aggregating the following data for matching condition "status=New" and get count till that day. For example: For below collection: [ { "_id": "abcd123", "Date": ISODate("2018-06-08T09:42:36.000Z"), "status": "New", }, { "_id":...
5 Apr 2015 by ColdskyXia
Installing Mongodb
8 Apr 2015 by ColdskyXia
How to get started with mongodb
12 Apr 2015 by ColdskyXia
How to add new documents to a collection more efficiently
12 Apr 2015 by ColdskyXia
How to remove documents from a collection more efficiently
27 Feb 2014 by Curt C Tabor
Hi,I'm new to Mongo. I need to iterate documents in a query result, update a single field and save the document.My understanding is that I need to iterate the query result with a cursor, get the record's _id, and then use that in the search query that is passed in the call to...
18 Jul 2015 by cy163@hotmail.com
I am storing time series data (machine monitoring data) with MongoDB. The data model looks like the following,which is inspired by the internet article "MongoDB as a Time Series Database"{ timestamp_hour: ISODate("2013-10-10T23:00:00.000Z"), type: “Voltage”, values: { 0: { 0:...
14 Jan 2022 by Cyber Noob
This is the error I obtain while running the below code. Traceback (most recent call last): File "E:\Anaconda Projects\Mongo Projects\SDR Tool\csvtojson.py", line 16, in jsonString = json.dumps(jsonArray, indent=1,...
30 Apr 2015 by Dadu Da
the files name look like these Doc.0 Doc.1 Doc.2 Doc.3 Doc.4but Doc.ns file never regenerate like above file
9 Nov 2021 by Daniele Fontani
That is the question. A comparison between these two technologies and some tips to choose the best that suits your needs.
1 Mar 2019 by Daniele Fontani
Tech overview about Headless CMS and implementation on ASP.NET Core
25 Mar 2019 by Daniele Fontani, keggyy
In this article, we explain GraphQL and show how to use it with an unstructured database (MongoDB)
28 May 2018 by Dave Kreskowiak
Whether or not you use Entity Framework is a matter of preference. There is nothing that says you have to use it. The difference being the amount of control you want and the amount of code you want to write. If you want to limit the amount of code, use Entity Framework. If you want greater...
13 Mar 2023 by Dave Kreskowiak
Think about your query. What does ".is(2)" mean? Is it the month number? The day of the month? How about the yes? Maybe the hour, minutes, or seconds? How is your code telling the database that the 2 is a month? Hint: It's not.
21 Mar 2023 by Dave Kreskowiak
It takes forever because you're looking for a couple of strings, "Disabled" and "Opted Out", probably without any indexing on the field. This is probably the worst way to get the status in terms of performance. If you were looking for integer...
28 Mar 2023 by Dave Kreskowiak
You showed everything except the one line that loads the "main.js" script and that's the one that matters. Judging by the error message alone, you need to change that tag to read something like:
26 Aug 2016 by David_Wimbley
To access a rest API from angular, inside your controller for whatever portion of your app is accessing it, you'll need to use $http.get to access it.app.controller("YourNameForController", ['$scope', '$location','$routeParams', '$http', function ($scope, $location, $routeParams, $http) { ...
1 Mar 2021 by Deep Dipe
I am trying to create a program that allows users to create lists and save data inside lists. I have created two pages first page has the data and second page where you create a list. Let me tell you the problem, as if I create three lists and I...
20 Oct 2020 by deepika44
how to read Json Array file and pass it as a function arguments for testing the function n java here i need to pass the properties argument to the below function. my function is below: public static void convertDateAttrsToString(JSONArray...
29 Jul 2017 by DevD9
Hello, I am working on one assignment using WPF and MongoDB. I need to generate WPF DataGrid(any other control will be fine if it works) at runtime from List of Dictionary. This is simple collection Dictionary where each Dictionary has different set of keypairs.So far i am...