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

learn more… | top users | synonyms

36
votes
2answers
5k views

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 ...
18
votes
2answers
17k views

Can I use MongoDB for a commercial web based service?

Can I use MongoDB as the database for providing a paid service? MongoDB is licensed under the AGPL, but the drivers I'm using are MIT licensed. Do I have to buy a commercial license for MongoDB or ...
8
votes
6answers
9k views

Is MongoDB the right choice in my case? [closed]

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 ...
8
votes
4answers
4k views

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

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 ...
6
votes
2answers
3k views

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 ...
5
votes
3answers
2k views

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 ...
5
votes
1answer
5k views

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 ...
5
votes
1answer
3k views

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 ...
4
votes
1answer
635 views

what is sharding in MongoDB

i have just reading MongoDB.came across sharding but not getting what exactly is it .watever i understood is its better to have more small servers than a huge one for data storage and when data ...
4
votes
2answers
7k views

What is a reasonable way to structure relationships in MongoDB

I am also using Node - which I am not the most familiar with - if the articles/books/tutorials pertained to this also - that would help even more. I come from a mostly MySQL background - but in this ...
4
votes
3answers
670 views

Is MongoDB appropriate for systems that will be likely to change?

I've been using MongoDb (mainly with Meteor) and for me, it has been a great way to mock up prototypes and proof of concepts quickly. I'm just wondering, after building the initial product, if your ...
4
votes
2answers
210 views

Does the use of mongodb enhance extending/changing database driven applications?

When an application is created which need to store data, an SQL database is used very often. So did I in a lot of asp.net applications. The resulting applications have often an ORM like the entity ...
4
votes
2answers
61 views

Is it a good idea not to embed certain one-to-one relationships in a Mongo database?

I'm designing a NoSQL database schema - MongoDB in particular - and I'm wondering if it's a good idea not to embed certain one-to-one relationships. For one example, I have an accounts collection, ...
4
votes
2answers
2k views

Rails and Mongoid best way to implement sharing system

I have to model User and Board in rails using mongoid as ODM. Each board is referenced to an user through a foreign key user_id and now I want to add the ability to share a board with other users. ...
4
votes
3answers
292 views

How would you represent an object that can be of multiple types, when storing it as a document in MongoDB?

Somewhat related to this question, say that I have an object category which, depending on which type of object I have, has different restrictions on what it contains. (if you can reword the previous ...
4
votes
1answer
359 views

Do serialization functions belong in a model or a controller?

I'm developing an application where: Models keep data as a multi-dimensional array, which are saved as-is to a MongoDB database. The model is used to provide methods to manipulate the data, and ...
4
votes
0answers
39 views

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

https://docs.mongodb.com/v3.0/reference/method/db.collection.find/#query-exact-matches-on-embedded-documents The following operation returns documents in the bios collection where the embedded ...
4
votes
0answers
216 views

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 ...
4
votes
3answers
174 views

Algorithm that generates a group of men and women who are each interested in everyone from the other gender

In my dating app, I need to compile lists of men and women where all of the men in the list are potentially interested in all of the women in the list, and vice versa. That is, in a list of 10 men ...
3
votes
2answers
4k views

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 ...
3
votes
1answer
1k views

Should I / can I bundle node.js and mongod together with my application?

I'm working on a web application that runs on node.js and uses MongoDB. It's important to mention that I plan to release the application as commercial software. The way I wrote the installer, it asks ...
3
votes
1answer
1k views

What is the recommended MongoDB schema for this quiz-engine scenario?

I'm working on a quiz engine for learning a foreign language. The engine shows users four images simultaneously and then plays an audio file. The user has to match the audio to the correct image. ...
3
votes
2answers
3k views

Document-oriented vs Column-oriented database fit [closed]

I have a data-intensive application that desperately needs a database make-over. The general data model: There are records with RIDs, grouped together by group IDs (GID). The records have arbitrary ...
3
votes
1answer
560 views

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 ...
3
votes
1answer
194 views

Best-matching comparative values using all items in array

I have two arrays of objects (items) in the exact same format. Each item represents a wager, and each array represents one of two outcomes for that wager (ex: Team A vs Team B). Both arrays look ...
2
votes
4answers
663 views

Are NoSQL databases the best choice for more efficiently querying large amounts of data?

We are planning to build a travel website in which we will be integrating multiple APIs (eg. DOTW, GTA, Expedia) for Hotels. I have initially tried to use MySQL but since there are huge amounts of ...
2
votes
2answers
856 views

MongoDB: Is this a good schema design?

I'm working on a Meteor app which lets users create events and assign them crew members. I've played around with MongoDB before and made some experiences along the way, where for instance my first ...
2
votes
1answer
10k views

How to connect Android App to MongoDB deployed on Google Cloud

Currently I am working on a simple app which will be able to connect to MongoDB which is deployed in Google Cloud. I have set it up MongoDB ocaly on my computer and I have made a little JAVA console ...
2
votes
3answers
79 views

How to properly store messages in a webservice?

We are building a multitenant webservice with PHP and MongoDB. There is a need for communication between service employees and clients, communication can be established in many different ways. Some of ...
2
votes
1answer
218 views

Should I use MongoDB for reference data?

I have a need to implement a number of microservices that will provide validation and lookup services. Each will hold independent and (essentially) read-only reference data. In each case, the data ...
2
votes
1answer
126 views

Should I store cryptographic hashes as a blob or as a string?

I'm new to MongoDB and am wondering how to decide to store some cryptographic hashes. Should I store the binary data itself, as a blob, or should I store its string representation as a string? My ...
2
votes
1answer
449 views

Node.js API Architecture

I am currently working on a web app and want to design the interface between nodejs / mongoose and the backbone app. A short description of the app: A user signs up to the application and gets a ...
2
votes
2answers
362 views

Is it appropriate to use id-s in MongoDb subdocuments?

I'm currently familiarizing myself with NoSQL by building a simple web application using MongoDb with the official C# driver. If i have understood the NoSQL concept correctly, then only the aggregate ...
2
votes
1answer
98 views

Proper tree NoSQL structure with focus on full-text searching

I developing an app with tree(folder-file) structure, on which I should perform full-text searches with MongoDB. I did a research on the best tree structure practices and found this great article, but ...
2
votes
1answer
676 views

MongoDB Embedded vs Reference Private info

I have searched extensively for a similar Mongo schema design and can't find relevant examples. I have a store (with public info), each store has an account (with private account info). // store ...
2
votes
1answer
4k views

Storing data in elasticsearch vs mongodb

We are trying to create an online-shopping like application in which we have to store a huge amount of data,since the data that will be stored are mostly document like data, the suggestion was to ...
2
votes
1answer
243 views

Do I need to publish deployment scripts for deploying AGPL licensed work (MongoDB)

MongoDB is dual-licensed with AGPL (the engine) and ASL 2.0 (the drivers). In a nutshell, merely using MongoDB through the drivers does not dictate to release your source code (due to drivers' ASL 2.0 ...
2
votes
1answer
530 views

Sub-Resource data should be embedded in Resource entity or duplicated in NoSQL document?

I have a scenario similar to as depicted below, public class Post { private int id; private int postType; private int score; private User originalPoster; private String title; ...
2
votes
1answer
222 views

In-memory DB to perform intersects on set slices

I have a specific programming need where I need to efficiently store large sorted sets in memory, query them for ranges, and intersect them against other sets that are also queried for ranged. I am ...
2
votes
0answers
77 views

Ideal Database for Big Data with Graph Relationships [closed]

The Requirement My application ingests a decent amount of data and need to traverse relationships between the data and do aggregations/projections on that data with volume like 1m+ document/rows/...
2
votes
0answers
90 views

Upload, convert, and store multiple different product data feeds into a database

I'm not sure if this right location for this question, but here it is. I currently have about 30 different CSV or TXT product data feeds. I am trying to build a tool to 1) upload each feed 2) ...
2
votes
0answers
210 views

Authenticate Joomla user from an external app based on Node.js, Javascript and MongoDB

I have an iOS App which currently pulls in all the data from the MongoDB using a Node.js server. Currently my API / my node server handles all the data manipulation the iOS app/Swift only displays the ...
2
votes
3answers
179 views

Help me design this use case

I have following entities: Data: User_id Categories: Interests, Disinterests, Categories A, B C... Each categories have sub categories: Interests=Gaming, Physics, Programming etc.. Now each user ...
2
votes
0answers
686 views

How to link the data of MongoDB and Neo4j?

I want to implement a system which store the profiles of employee and the resources that they have. There are many types of resources, such as the documents they produced, the techniques they have......
2
votes
2answers
2k views

Why is MongoDb popular with Node.js? [closed]

I've been looking att different web stacks, mainly rails and node.js. One thing that strikes me is that while rails is often used with a relational database Node.js seem to go hand in hand with ...
1
vote
2answers
195 views

When should I implement authentication in a database?

I'm currently embarking on a MongoDB project (a simple user login system), and I notice that there is an option for authentication. Here is the server string, with the userinfo shown as optional ...
1
vote
1answer
353 views

database migration with data already in the database in production

I don't know much about migrations, but this is a specific question I'm not sure how to answer. In production, how can one change the database format/schema when there is already user data in there? (...
1
vote
2answers
758 views

Search algorithm

I would like to create a site where users can post articles with the following optional parts: A title Contents (text) Categories Keywords Articles will be stored in mongodb and the site will be ...
1
vote
2answers
770 views

Very-Loose Coupling and Dependency Injection for Database Management

I'm currently setting up a MongoDB database for a web-app. I'm running node.js and using Mongoose to help manage mapping, validation ect. I'm wondering if it's a good idea to really decouple MongoDB ...
1
vote
1answer
176 views

How should I implement a full text search into my meteor web app?

I am making a web application using the javascript framework Meteor, which runs with mongodb. In the web app I have a db set up that holds individual video games in the documents. An example of this ...