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 https://dba.stackexchange.com.

MongoDB is a widely used, general-purpose, document-oriented database with a multitude of features including replication for redundancy and high availability and sharding for horizontal scaling.

The MongoDB Community Edition database server and tools are source-available under Server Side Public License (all versions released after October 16, 2018) or open-source under AGPL v3.0 license (versions released prior to October 16, 2018). Commercial Licenses are also available from MongoDB, Inc.

MongoDB offers a powerful query language, MQL, and provides the Aggregation Framework and Map/Reduce for even more complex queries. MongoDB uses the BSON format for storing data and the MongoDB Wire Protocol for communication between client drivers and the MongoDB server. Officially supported Drivers and Client Libraries are available for most popular programming languages, and there are also Community Supported Drivers which offer alternative implementations and support for further programming languages.

The latest MongoDB server releases can be installed via common packaging systems or downloaded as binary archives from mongodb.com.

The current production release series of MongoDB is 6.0. It is generally recommended to stay current with the latest minor release of a production release series (e.g. 6.0.1) to take advantage of bug fixes and backward-compatible improvements. For more information on the versioning scheme used by the server, see MongoDB Version Numbers.

MongoDB has a GUI called MongoDB Compass, which is a powerful GUI for querying, aggregating, and analyzing your MongoDB data in a visual environment. Compass is free to use and source available and can be run on macOS, Windows, and Linux.

FAQ

MongoDB Community Forums are the official home for community discussion, product/driver announcements, and introductions.

For help with data modeling (schema design), check out the Data Models documentation page, the Building with Patterns blog series, and M320: Data Modeling course at MongoDB University.

For information on MongoDB Security, view the Security section of the MongoDB Manual which includes a MongoDB Security Checklist.

MongoDB, Inc. (the company behind MongoDB) provides archives of many presentations from their events such as conferences and webinars. They also develop a number of related tools and services including MongoDB Cloud Manager, MongoDB Ops Manager, MongoDB Atlas, and MongoDB Compass.

Useful links

Related Tags

Initial Release:

Feb 11, 2009

Latest Production Release Series:

6.0 (July 19, 2022 - Release notes)

Books

Articles

174599 questions
27
votes
1 answer

MongoDB for commercial use

As I am pretty horrible in reading English legal documents I hoped one of you could answer this question. In about a month I need to do an internship at a company for my bachelor. They would like me to develop a system for internal use (will not be…
SomeDutchGuy
  • 2,249
  • 4
  • 16
  • 42
27
votes
2 answers

Warning message in PyMongo: count is deprecated

def post(self): if db.users.find({"email": email}).count() != 0: abort(400, message="email is alread used.") DeprecationWarning: count is deprecated. Use Collection.count_documents instead. I'm making authentication server with…
EnDelt64
  • 1,270
  • 3
  • 24
  • 31
27
votes
4 answers

Get particular element from mongoDB array

I have mongo collection like below { "auther" : "xyz" , "location" : "zzz" , "books" : [ {"book1" : "b1" , "date" : 2-3-00} , {"book1" : "b2" , "date" : 4-9-00} ] } { "auther" : "pqr", "location" : "zzz" , …
Swapnil Sonawane
  • 1,445
  • 3
  • 22
  • 37
27
votes
2 answers

MongoDB : Indexes order and query order must match?

This question concern the internal method to manage indexes and serching Bson Documents. When you create a multiple indexes like "index1", "index2", "index3"...the index are stored to be used during queries, but what about the order of queries and…
user325558
  • 1,413
  • 5
  • 22
  • 35
27
votes
4 answers

Add field not in schema with mongoose

I am trying to add a new field to a document, but this isn't working: Creating my UserModel prototype: model = require("../models/user") UserModel.prototype.findOneAndUpdate = function(query, params, cb) { model.findOneAndUpdate(query, params, {…
LuisEgan
  • 952
  • 2
  • 13
  • 28
27
votes
9 answers

MongoError: Unknown modifier: $pushAll in node js

I am having an issue when saving a model fails with mongo error: MongoError: Unknown modifier: $pushAll. I have one array field subDomains in my schema and which will get saved as default with subdomain as like follows. // already Domain instance…
Santosh Shinde
  • 6,045
  • 7
  • 44
  • 68
27
votes
4 answers

Connect to host mongodb from docker container

So I want to connect to my mongodb running on my host machine (DO droplet, Ubuntu 16.04). It is running on the default 27017 port on localhost. I then use mup to deploy my Meteor app on my DO droplet, which is using docker to run my Meteor app…
Patrick DaVader
  • 2,133
  • 4
  • 24
  • 35
27
votes
5 answers

Creating a database in Mongo: can't connect, get "connect failed"

I want to create a new database in Mongo. However, I'm having trouble connecting: :~$ mongo MongoDB shell version: 1.6.5 connecting to: test Tue Dec 21 18:16:25 Error: couldn't connect to server 127.0.0.1 (anon):1154 exception: connect failed How…
AP257
  • 89,519
  • 86
  • 202
  • 261
27
votes
5 answers

Initialize data on dockerized mongo

I'm running a dockerized mongo container. I'd like to create a mongo image with some initialized data. Any ideas?
Jordi
  • 20,868
  • 39
  • 149
  • 333
27
votes
7 answers

How to do inner joining in MongoDB?

Is it possible to do SQL inner joins kind of stuff in MongoDB? I know there is the $lookup attribute in an aggregation pipeline and it is equivalent to outer joins in SQL, but I want to do something similar to inner joins. I have three collections…
Asantha Thilina
  • 557
  • 1
  • 7
  • 12
27
votes
2 answers

How does sorting with an index work in MongoDB?

I'm wondering how sorting with an index actually works in MongoDB. There are a couple articles in the MongoDB documentation, but they don't actually describe how the sort proceeds or the time complexity. Searches of SO and the interweb in general so…
elhefe
  • 3,404
  • 3
  • 31
  • 45
27
votes
9 answers

Connecting to MongoDB database on mLab fails authentication

I have a Parse app, and I'm trying to migrate my app's database to a MongoDB instance on mLab. I already have a fork of Parse Server set up on Heroku, and I'm using Heroku's mLab MongoDB add-on. I have a database on mLab called heroku_1ksph3jj, and…
Adam Colvin
  • 751
  • 1
  • 6
  • 16
27
votes
3 answers

C# mongodb driver 2.0 - How to upsert in a bulk operation?

I migrated from 1.9 to 2.2 and reading the documentation I was surprised to discover that is not possible to upsert during a bulk operation anymore, since operations don't allow options. bulkOps.Add(new UpdateOneModel(filter,…
Adrian Lopez
  • 2,601
  • 5
  • 31
  • 48
27
votes
2 answers

How to load initial data in MongoDB?

Does anyone know how to populate mongodb with initial data? For example, with a traditional SQL database, you can put all your SQL statements in a textfile, then load that using a SQL command. This is extremely useful for unit testing. Is it…
Erin Drummond
  • 5,347
  • 6
  • 35
  • 41
27
votes
4 answers

Mongodb array $push and $pull

I was looking to pull some value from array and simultaneously trying to update it. userSchema.statics.experience = function (id,xper,delet,callback) { var update = { $pull:{ 'profile.experience' : delet }, …
santhosh
  • 1,919
  • 3
  • 21
  • 33
1 2 3
99
100