Questions tagged [mongodb]

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

enter image description here

MongoDB is a widely used, general-purpose, document-oriented NoSQL database with features including high-availability replication and auto-sharding for horizontal scaling. The MongoDB database server and tools, written in C++, are open-sourced and available under AGPL v3.0 license or a Commercial License. MongoDB has strong support for dynamic querying and aggregating data including MapReduce and an Aggregation Framework. MongoDB uses BSON (Binary JSON) format for storage purposes 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.org.

FAQ

The mongodb-user mailing list is very busy and almost every question on earth has been asked on there, so try searching the archives. Tip: searching Google with " site:groups.google.com/group/mongodb-user" added to your search terms generally works better than using the Google Groups search bar.

For help with data modeling (schema design), check out the Data Modeling Considerations for MongoDB Applications documentation page or search the mailing list archives.

MongoDB, Inc. (the company behind MongoDB) provides archives of many presentations from their events such as conferences and webinars.

Useful links

201 questions
128
votes
10 answers

Storing a re-orderable list in a database

I'm working on a wishlist system, where users can add items to their various wishlists, and I plan to allow users to re-order the items later on. I am not really sure about the best way to go about storing this in a database while remaining fast and…
Tom Brunoli
  • 1,383
  • 2
  • 9
  • 6
56
votes
4 answers

Why is using MySQL for a dictionary website a bad idea?

I'm planning to design and set up a database to store dictionary entries (usually single words) and their meaning in another language. So, for example, the table Glossary must have entry and definition and each table record has a reference to the id…
50
votes
3 answers

Strategy for generating unique and secure identifiers for use in a "sometimes offline" web app

I have a web based project that allows users to work both online and offline and I'm looking for a way to generate unique ids for records on the client side. I'd like an approach that works while a user is offline (i.e. unable to talk to a server),…
herbrandson
  • 611
  • 1
  • 6
  • 7
26
votes
5 answers

When should we use MongoDB?

MongoDB is a NoSQL database which I've found quite easy to use. Recently I had to develop a simple application which needed to collect some data using HTTP requests and store some results after processing the data, and I tried using MongoDB. From…
user1620696
  • 4,817
  • 7
  • 31
  • 46
19
votes
3 answers

Should backend IDs be public or not on a REST API?

Based on what this guy says: http://toddfredrich.com/ids-in-rest-api.html Let assume he is right about using UUID to identify the api resources. Then I run into troubles trying to implementing it that way, this is: class FooEntity { final…
anat0lius
  • 999
  • 2
  • 9
  • 10
17
votes
3 answers

Inserting JSON document with `.` in key to MongoDB

Firstly, this is more of a design question than a programming question. I am creating an application where I have to fetch existing JSON data and insert it into MongoDB. I found that some of the the JSON documents have a period . in their key. I…
anirudh
  • 271
  • 1
  • 2
  • 4
14
votes
1 answer

How do I represent a schema diagram of my MongoDB database?

I have a MongoDB database that I want to properly document its schema design. I know that MongoDB is a NoSQL database and is schemaless by nature, but I do enforce a schema through my application and I want to represent it in a better way than a…
Zanon
  • 329
  • 2
  • 3
  • 16
10
votes
1 answer

Why does MongoDB check for order of keys when matching embedded documents?

The db.collection.find() documentation includes this explanation of Query Exact Matches on Embedded Documents: The following operation returns documents in the bios collection where the embedded document name is exactly { first: "Yukihiro", last:…
tscizzle
  • 313
  • 2
  • 10
10
votes
6 answers

Is MongoDB the right choice in my case?

I'm going to build my first real project in Rails that consist in a web app made of 3 main parts: The static part where no database is used The User registration part which will require a database and I can use MySQL since each user's row will have…
Matteo Pagliazzi
  • 366
  • 1
  • 5
  • 15
9
votes
1 answer

Architecture for a mobile (Android) chat application

I want to develop a chat application that reminds a bit whatsapp, I am doing it as a learning project. I am currently doing it on Android just because I am doing an Android course. The requirements are: users register with some data (phone number,…
user1002065
  • 193
  • 1
  • 1
  • 3
8
votes
4 answers

I want a trivial example of where MongoDB can scale but a relational database will have trouble

I'm just learning to use MongoDB, and when discussing with other programmers would like a quick example of why NoSQL can be a good choice compared to a traditional RDBMS - however the scenarios I come up with and can find online seem pretty…
Ryan Weir
  • 231
  • 3
  • 8
8
votes
2 answers

What is a good pattern for multi language in MongoDb?

Say I want to build a website that support multiple language and use MongoDB datastore. I wonder what is a good approach to have multiple versions of the body and title of an article, one for each language. Should I keep all versions in the same…
Gabriel Smoljar
  • 365
  • 1
  • 3
  • 10
8
votes
3 answers

DDD - Aggregate Roots - Dealing with Efficiency and Concurrency

First off, I'll admit that I'm a newbie to DDD and need to read the "blue book". I'm building a system that has an AggregateRoot of type "Match". Each Match can have a collection of "Votes" and also has a readonly "VoteCount" property which gets…
drogon
  • 334
  • 3
  • 8
7
votes
2 answers

How to represent a tree structure in NoSQL

I'm new to NoSQL and have been playing around with a personal project on the MEAN stack (Mongo ExpressJs AngularJs NodeJs). I'm building a document editor of sorts that manages nodes of data. Each document is actually a tree. I have a CRUD api for…
Vlad Nicula
  • 279
  • 1
  • 3
  • 6
7
votes
2 answers

How to model hashtags with nodejs and mongodb

Existing architecture: nodejs server with mongodb backend. I have strings coming in describing images that can have #hashtags in them. I wish to extract the hashtags from the strings, store the hashtags and associate the image with that hashtag. So…
Dave
  • 171
  • 1
  • 1
  • 2
1
2 3
13 14